<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/notes.c, branch v2.4.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.4.9</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-09-04T17:29:28Z</updated>
<entry>
<title>Sync with 2.2.3</title>
<updated>2015-09-04T17:29:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-04T17:29:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8267cd11d677f1a5f8441ac2880f5e9d48dba60b'/>
<id>urn:sha1:8267cd11d677f1a5f8441ac2880f5e9d48dba60b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>notes: use a strbuf in add_non_note</title>
<updated>2015-09-04T16:36:28Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-08-19T18:12:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c29edfefb6f6a3fef80172c16bcc34c826d417b0'/>
<id>urn:sha1:c29edfefb6f6a3fef80172c16bcc34c826d417b0</id>
<content type='text'>
When we are loading a notes tree into our internal hash
table, we also collect any files that are clearly non-notes.
We format the name of the file into a PATH_MAX buffer, but
unlike true notes (which cannot be larger than a fanned-out
sha1 hash), these tree entries can be arbitrarily long,
overflowing our buffer.

We can fix this by switching to a strbuf. It doesn't even
cost us an extra allocation, as we can simply hand ownership
of the buffer over to the non-note struct.

This is of moderate security interest, as you might fetch
notes trees from an untrusted remote. However, we do not do
so by default, so you would have to manually fetch into the
notes namespace.

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 '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>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>sort_string_list(): rename to string_list_sort()</title>
<updated>2014-11-25T18:11:34Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-11-25T08:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3383e199847485fedf83d0fa38bbd5363074093a'/>
<id>urn:sha1:3383e199847485fedf83d0fa38bbd5363074093a</id>
<content type='text'>
The new name is more consistent with the names of other
string_list-related functions.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>notes: empty notes should be shown by 'git log'</title>
<updated>2014-11-12T19:00:22Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2014-11-12T00:40:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8a4acd699536c518c9245714d6175aa39d13eb9d'/>
<id>urn:sha1:8a4acd699536c518c9245714d6175aa39d13eb9d</id>
<content type='text'>
If the user has gone through the trouble of explicitly adding an empty
note, then "git log" should not silently skip it (as if it didn't exist).

Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>notes.c: rearrange xcalloc arguments</title>
<updated>2014-05-27T21:02:45Z</updated>
<author>
<name>Brian Gesiak</name>
<email>modocache@gmail.com</email>
</author>
<published>2014-05-26T15:33:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65bbf082c27bcc4544511b642fb311e5f3c21722'/>
<id>urn:sha1:65bbf082c27bcc4544511b642fb311e5f3c21722</id>
<content type='text'>
xcalloc() takes two arguments: the number of elements and their size.
notes.c includes several calls to xcalloc() that pass the arguments in
reverse order.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak &lt;modocache@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>replace {pre,suf}fixcmp() with {starts,ends}_with()</title>
<updated>2013-12-05T22:13:21Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-11-30T20:55:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=59556548230e617b837343c2c07e357e688e2ca4'/>
<id>urn:sha1:59556548230e617b837343c2c07e357e688e2ca4</id>
<content type='text'>
Leaving only the function definitions and declarations so that any
new topic in flight can still make use of the old functions, replace
existing uses of the prefixcmp() and suffixcmp() with new API
functions.

The change can be recreated by mechanically applying this:

    $ git grep -l -e prefixcmp -e suffixcmp -- \*.c |
      grep -v strbuf\\.c |
      xargs perl -pi -e '
        s|!prefixcmp\(|starts_with\(|g;
        s|prefixcmp\(|!starts_with\(|g;
        s|!suffixcmp\(|ends_with\(|g;
        s|suffixcmp\(|!ends_with\(|g;
      '

on the result of preparatory changes in this series.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string_list_add_refs_by_glob(): add a comment about memory management</title>
<updated>2013-06-02T22:28:47Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2013-05-25T09:08:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8c46bf904fe95105faaa1823332c91d2802182c2'/>
<id>urn:sha1:8c46bf904fe95105faaa1823332c91d2802182c2</id>
<content type='text'>
Since string_list_add_one_ref() adds refname to the string list, but
the lifetime of refname is limited, it is important that the
string_list passed to string_list_add_one_ref() has strdup_strings
set.  Document this fact.

All current callers do the right thing.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
