<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs.c, branch v2.3.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-02-25T06:09:54Z</updated>
<entry>
<title>Merge branch 'jk/blame-commit-label' into maint</title>
<updated>2015-02-25T06:09:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-02-25T06:09:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=faf723a631aff822b4808c496c0970edb0ca2a99'/>
<id>urn:sha1:faf723a631aff822b4808c496c0970edb0ca2a99</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>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>refs: plug strbuf leak in lock_ref_sha1_basic()</title>
<updated>2014-12-29T21:14:16Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-12-24T00:18:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=33adc83ddb315a614a59604a0d39caa5a1b27bdd'/>
<id>urn:sha1:33adc83ddb315a614a59604a0d39caa5a1b27bdd</id>
<content type='text'>
Don't just reset, but release the resource held by the local
variable that is about to go out of scope.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/read-packed-refs-without-path-max'</title>
<updated>2014-12-22T20:28:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-22T20:28:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa9066fccd4a4320ab3e90f566527b7497d2c7c0'/>
<id>urn:sha1:aa9066fccd4a4320ab3e90f566527b7497d2c7c0</id>
<content type='text'>
Git did not correctly read an overlong refname from a packed refs
file.

* jk/read-packed-refs-without-path-max:
  read_packed_refs: use skip_prefix instead of static array
  read_packed_refs: pass strbuf to parse_ref_line
  read_packed_refs: use a strbuf for reading lines
</content>
</entry>
<entry>
<title>Merge branch 'jk/for-each-reflog-ent-reverse'</title>
<updated>2014-12-22T20:27:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-22T20:27:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6f3abb7a8743bbd0bffa11a3f5df84d0da532c59'/>
<id>urn:sha1:6f3abb7a8743bbd0bffa11a3f5df84d0da532c59</id>
<content type='text'>
The code that reads the reflog from the newer to the older entries
did not handle an entry that crosses a boundary of block it uses to
read them correctly.

* jk/for-each-reflog-ent-reverse:
  for_each_reflog_ent_reverse: turn leftover check into assertion
  for_each_reflog_ent_reverse: fix newlines on block boundaries
</content>
</entry>
<entry>
<title>Merge branch 'mh/simplify-repack-without-refs'</title>
<updated>2014-12-22T20:26:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-22T20:26:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a7ddaa8eacb45fdd5241e52d72e6f75d8b67b953'/>
<id>urn:sha1:a7ddaa8eacb45fdd5241e52d72e6f75d8b67b953</id>
<content type='text'>
"git remote update --prune" to drop many refs has been optimized.

* mh/simplify-repack-without-refs:
  sort_string_list(): rename to string_list_sort()
  prune_remote(): iterate using for_each_string_list_item()
  prune_remote(): rename local variable
  repack_without_refs(): make the refnames argument a string_list
  prune_remote(): sort delete_refs_list references en masse
  prune_remote(): initialize both delete_refs lists in a single loop
  prune_remote(): exit early if there are no stale references
</content>
</entry>
<entry>
<title>read_packed_refs: use skip_prefix instead of static array</title>
<updated>2014-12-10T17:40:33Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-10T10:40:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea417833ea9a07d7b8d568358ff20f57851cb26e'/>
<id>urn:sha1:ea417833ea9a07d7b8d568358ff20f57851cb26e</id>
<content type='text'>
We want to recognize the packed-refs header and skip to the
"traits" part of the line. We currently do it by feeding
sizeof() a static const array to strncmp. However, it's a
bit simpler to just skip_prefix, which expresses the
intention more directly, and without remembering to account
for the NUL-terminator in each sizeof() call.

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>read_packed_refs: pass strbuf to parse_ref_line</title>
<updated>2014-12-10T17:28:54Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-10T10:40:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6a49870a7245934eac671e3dcd7186a90dac255d'/>
<id>urn:sha1:6a49870a7245934eac671e3dcd7186a90dac255d</id>
<content type='text'>
Now that we have a strbuf in read_packed_refs, we can pass
it straight to the line parser, which saves us an extra
strlen.

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>read_packed_refs: use a strbuf for reading lines</title>
<updated>2014-12-10T17:27:24Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-10T10:40:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=10c497aa0cc7ccb5bd213f53fc0cd803bd73a508'/>
<id>urn:sha1:10c497aa0cc7ccb5bd213f53fc0cd803bd73a508</id>
<content type='text'>
Current code uses a fixed PATH_MAX-sized buffer for reading
packed-refs lines. This is a reasonable guess, in the sense
that git generally cannot work with refs larger than
PATH_MAX.  However, there are a few cases where it is not
great:

  1. Some systems may have a low value of PATH_MAX, but can
     actually handle larger paths in practice. Fixing this
     code path probably isn't enough to make them work
     completely with long refs, but it is a step in the
     right direction.

  2. We use fgets, which will happily give us half a line on
     the first read, and then the rest of the line on the
     second. This is probably OK in practice, because our
     refline parser is careful enough to look for the
     trailing newline on the first line. The second line may
     look like a peeled line to us, but since "^" is illegal
     in refnames, it is not likely to come up.

     Still, it does not hurt to be more careful.

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>for_each_reflog_ent_reverse: turn leftover check into assertion</title>
<updated>2014-12-05T19:11:52Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-05T01:32:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=69216bf72be2be4f8aa932324b3145d3f395cdc6'/>
<id>urn:sha1:69216bf72be2be4f8aa932324b3145d3f395cdc6</id>
<content type='text'>
Our loop should always process all lines, even if we hit the
beginning of the file. We have a conditional after the loop
ends to double-check that there is nothing left and to
process it. But this should never happen, and is a sign of a
logic bug in the loop. Let's turn it into a BUG assertion.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
