<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/config.c, branch v2.4.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.4.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.4.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-05-13T21:05:51Z</updated>
<entry>
<title>Merge branch 'cn/bom-in-gitignore' into maint</title>
<updated>2015-05-13T21:05:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-05-13T21:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a1d89745d1b60d0d9e8bd91e4e9564673b6c22a'/>
<id>urn:sha1:8a1d89745d1b60d0d9e8bd91e4e9564673b6c22a</id>
<content type='text'>
Teach the codepaths that read .gitignore and .gitattributes files
that these files encoded in UTF-8 may have UTF-8 BOM marker at the
beginning; this makes it in line with what we do for configuration
files already.

* cn/bom-in-gitignore:
  attr: skip UTF8 BOM at the beginning of the input file
  config: use utf8_bom[] from utf.[ch] in git_parse_source()
  utf8-bom: introduce skip_utf8_bom() helper
  add_excludes_from_file: clarify the bom skipping logic
  dir: allow a BOM at the beginning of exclude files
</content>
</entry>
<entry>
<title>config: use utf8_bom[] from utf.[ch] in git_parse_source()</title>
<updated>2015-04-16T18:35:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-04-16T17:47:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=599446dc323d15bab7f2a54f57ae8c5c4d7d6103'/>
<id>urn:sha1:599446dc323d15bab7f2a54f57ae8c5c4d7d6103</id>
<content type='text'>
Because the function reads one character at the time, unfortunately
we cannot use the easier skip_utf8_bom() helper, but at least we do
not have to duplicate the constant string this way.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/config-no-ungetc-eof'</title>
<updated>2015-02-18T19:45:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-02-18T19:45:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de15bdb0583a1a65bf1bab47b7bec9bdc03f727a'/>
<id>urn:sha1:de15bdb0583a1a65bf1bab47b7bec9bdc03f727a</id>
<content type='text'>
Reading configuration from a blob object, when it ends with a lone
CR, use to confuse the configuration parser.

* jk/config-no-ungetc-eof:
  config_buf_ungetc: warn when pushing back a random character
  config: do not ungetc EOF
</content>
</entry>
<entry>
<title>Merge branch 'jk/blame-commit-label'</title>
<updated>2015-02-11T21:39:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-02-11T21:39:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=092c4be7f5d691809913eb83a2360f035c67ab06'/>
<id>urn:sha1:092c4be7f5d691809913eb83a2360f035c67ab06</id>
<content type='text'>
"git blame HEAD -- missing" failed to correctly say "HEAD" when it
tried to say "No such path 'missing' in HEAD".

* jk/blame-commit-label:
  blame.c: fix garbled error message
  use xstrdup_or_null to replace ternary conditionals
  builtin/commit.c: use xstrdup_or_null instead of envdup
  builtin/apply.c: use xstrdup_or_null instead of null_strdup
  git-compat-util: add xstrdup_or_null helper
</content>
</entry>
<entry>
<title>config_buf_ungetc: warn when pushing back a random character</title>
<updated>2015-02-05T21:16:55Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-02-05T21:00:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1d0655c15ebf7dfb460466d058daab790ed285b2'/>
<id>urn:sha1:1d0655c15ebf7dfb460466d058daab790ed285b2</id>
<content type='text'>
Our config code simulates a stdio stream around a buffer,
but our fake ungetc() does not behave quite like the real
one. In particular, we only rewind the position by one
character, but do _not_ actually put the character from the
caller into position.

It turns out that this does not matter, because we only ever
push back the character we just read. In other words, such
an assignment would be a noop. But because the function is
called ungetc, and because it takes a character parameter,
it is a mistake waiting to happen.

Actually assigning the character into the buffer would be
ideal, but our pointer is actually a "const" copy of the
buffer. We do not know who the real owner of the buffer is
in this code, and would not want to munge their contents.

Instead, we can simply add an assertion that matches what
the current caller does, and will let us know if new callers
are added that violate the contract.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config: do not ungetc EOF</title>
<updated>2015-02-05T20:37:36Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-02-05T06:53:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5e0be134d35a31f41921f89331a95337bb38c152'/>
<id>urn:sha1:5e0be134d35a31f41921f89331a95337bb38c152</id>
<content type='text'>
When we are parsing a config value, if we see a carriage
return, we fgetc the next character to see if it is a
line feed (in which case we silently drop the CR). If it
isn't, we then ungetc the character, and take the literal
CR.

But we never check whether we in fact got a character at
all. If the config file ends in CR, we will get EOF here,
and try to ungetc EOF. This works OK for a real stdio
stream. The ungetc returns an error, and the next fgetc will
then return EOF again.

However, our custom buffer-based stream is not so fortunate.
It happily rewinds the position of the stream by one
character, ignoring the fact that we fed it EOF. The next
fgetc call returns the final CR again, over and over, and we
end up in an infinite loop.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use xstrdup_or_null to replace ternary conditionals</title>
<updated>2015-01-13T18:05:48Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-01-13T01:59:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8c53f0719b04e0b6328c2e175e3c5d2dc8a0c282'/>
<id>urn:sha1:8c53f0719b04e0b6328c2e175e3c5d2dc8a0c282</id>
<content type='text'>
This replaces "x ? xstrdup(x) : NULL" with xstrdup_or_null(x).
The change is fairly mechanical, with the exception of
resolve_refdup, which can eliminate a temporary variable.

There are still a few hits grepping for "?.*xstrdup", but
these are of slightly different forms and cannot be
converted (e.g., "x ? xstrdup(x-&gt;foo) : NULL").

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/maint-config-use-labs' into maint</title>
<updated>2014-12-22T20:17:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-22T20:17:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8c23511578fc0c708eb50899e294da454420ac6'/>
<id>urn:sha1:e8c23511578fc0c708eb50899e294da454420ac6</id>
<content type='text'>
* rs/maint-config-use-labs:
  use labs() for variables of type long instead of abs()
</content>
</entry>
<entry>
<title>Sync with v2.2.1</title>
<updated>2014-12-18T20:30:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-18T20:30:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3f1509809e728b70ea7912e4e1b40f22965e45ee'/>
<id>urn:sha1:3f1509809e728b70ea7912e4e1b40f22965e45ee</id>
<content type='text'>
* maint:
  Git 2.2.1
  Git 2.1.4
  Git 2.0.5
  Git 1.9.5
  Git 1.8.5.6
  fsck: complain about NTFS ".git" aliases in trees
  read-cache: optionally disallow NTFS .git variants
  path: add is_ntfs_dotgit() helper
  fsck: complain about HFS+ ".git" aliases in trees
  read-cache: optionally disallow HFS+ .git variants
  utf8: add is_hfs_dotgit() helper
  fsck: notice .git case-insensitively
  t1450: refactor ".", "..", and ".git" fsck tests
  verify_dotfile(): reject .git case-insensitively
  read-tree: add tests for confusing paths like ".." and ".git"
  unpack-trees: propagate errors adding entries to the index
</content>
</entry>
<entry>
<title>Sync with v2.1.4</title>
<updated>2014-12-17T19:46:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-17T19:46:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77933f4449b8d6aa7529d627f3c7b55336f491db'/>
<id>urn:sha1:77933f4449b8d6aa7529d627f3c7b55336f491db</id>
<content type='text'>
* maint-2.1:
  Git 2.1.4
  Git 2.0.5
  Git 1.9.5
  Git 1.8.5.6
  fsck: complain about NTFS ".git" aliases in trees
  read-cache: optionally disallow NTFS .git variants
  path: add is_ntfs_dotgit() helper
  fsck: complain about HFS+ ".git" aliases in trees
  read-cache: optionally disallow HFS+ .git variants
  utf8: add is_hfs_dotgit() helper
  fsck: notice .git case-insensitively
  t1450: refactor ".", "..", and ".git" fsck tests
  verify_dotfile(): reject .git case-insensitively
  read-tree: add tests for confusing paths like ".." and ".git"
  unpack-trees: propagate errors adding entries to the index
</content>
</entry>
</feed>
