<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ref-filter.c, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-05-19T23:55:00Z</updated>
<entry>
<title>Merge branch 'zh/ref-filter-push-remote-fix'</title>
<updated>2021-05-19T23:55:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-05-19T23:55:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=36a255acd14779ef21747b56341796e18c229976'/>
<id>urn:sha1:36a255acd14779ef21747b56341796e18c229976</id>
<content type='text'>
The handling of "%(push)" formatting element of "for-each-ref" and
friends was broken when the same codepath started handling
"%(push:&lt;what&gt;)", which has been corrected.

* zh/ref-filter-push-remote-fix:
  ref-filter: fix read invalid union member bug
</content>
</entry>
<entry>
<title>ref-filter: fix read invalid union member bug</title>
<updated>2021-05-11T23:13:14Z</updated>
<author>
<name>ZheNing Hu</name>
<email>adlternative@gmail.com</email>
</author>
<published>2021-05-11T15:35:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e1c4c5eac972516db47394ae94a52a3b97cb41a'/>
<id>urn:sha1:1e1c4c5eac972516db47394ae94a52a3b97cb41a</id>
<content type='text'>
used_atom.u is an union, and it has different members depending on
what atom the auxiliary data the union part of the "struct
used_atom" wants to record. At most only one of the members can be
valid at any one time. Since the code checks u.remote_ref without
even making sure if the atom is "push" or "push:" (which are only
two cases that u.remote_ref.push becomes valid), but u.remote_ref
shares the same storage for other members of the union, the check
was reading from an invalid member, which was the bug.

Modify the condition here to check whether the atom name
equals to "push" or starts with "push:", to avoid reading the
value of invalid member of the union.

Signed-off-by: ZheNing Hu &lt;adlternative@gmail.com&gt;
[jc: further test fixes]
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: get rid of show_ref_array_item</title>
<updated>2021-04-19T22:08:00Z</updated>
<author>
<name>ZheNing Hu</name>
<email>adlternative@gmail.com</email>
</author>
<published>2021-04-19T11:28:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=22f69a85edf29dba2278b55f14419e4ea48148d2'/>
<id>urn:sha1:22f69a85edf29dba2278b55f14419e4ea48148d2</id>
<content type='text'>
Inlining the exported function `show_ref_array_item()`,
which is not providing the right level of abstraction,
simplifies the API and can unlock improvements at the
former call sites.

Helped-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: ZheNing Hu &lt;adlternative@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/ref-filter-segfault-fix'</title>
<updated>2021-04-13T22:28:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-04-13T22:28:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f63add4aa8e8c2ea413fe2bf3b5c9b0f55617e8b'/>
<id>urn:sha1:f63add4aa8e8c2ea413fe2bf3b5c9b0f55617e8b</id>
<content type='text'>
A NULL-dereference bug has been corrected in an error codepath in
"git for-each-ref", "git branch --list" etc.

* jk/ref-filter-segfault-fix:
  ref-filter: fix NULL check for parse object failure
</content>
</entry>
<entry>
<title>ref-filter: fix NULL check for parse object failure</title>
<updated>2021-04-01T19:54:21Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2021-04-01T08:32:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c6854508808dd32e3fc20c5b021c4064d25f6438'/>
<id>urn:sha1:c6854508808dd32e3fc20c5b021c4064d25f6438</id>
<content type='text'>
After we run parse_object_buffer() to get an object's contents, we try
to check that the return value wasn't NULL. However, since our "struct
object" is a pointer-to-pointer, and we assign like:

  *obj = parse_object_buffer(...);

it's not correct to check:

  if (!obj)

That will always be true, since our double pointer will continue to
point to the single pointer (which is itself NULL). This is a regression
that was introduced by aa46a0da30 (ref-filter: use oid_object_info() to
get object, 2018-07-17); since that commit we'll segfault on a parse
failure, as we try to look at the NULL object pointer.

There are many ways a parse could fail, but most of them are hard to set
up in the tests (it's easy to make a bogus object, but update-ref will
refuse to point to it). The test here uses a tag which points to a wrong
object type. A parse of just the broken tag object will succeed, but
seeing both tag objects in the same process will lead to a parse error
(since we'll see the pointed-to object as both types).

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/xcalloc-takes-nelem-first'</title>
<updated>2021-03-19T22:25:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-03-19T22:25:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bfcc6e2a68b95ee71fc606a2e3917af78f1130f9'/>
<id>urn:sha1:bfcc6e2a68b95ee71fc606a2e3917af78f1130f9</id>
<content type='text'>
Code cleanup.

* rs/xcalloc-takes-nelem-first:
  fix xcalloc() argument order
</content>
</entry>
<entry>
<title>use CALLOC_ARRAY</title>
<updated>2021-03-14T00:00:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-03-13T16:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca56dadb4b65ccaeab809d80db80a312dc00941a'/>
<id>urn:sha1:ca56dadb4b65ccaeab809d80db80a312dc00941a</id>
<content type='text'>
Add and apply a semantic patch for converting code that open-codes
CALLOC_ARRAY to use it instead.  It shortens the code and infers the
element size automatically.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fix xcalloc() argument order</title>
<updated>2021-03-08T17:45:04Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-03-06T11:26:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=241b5d3ebeea21b70a74fdc8c74e73f7ed829cb1'/>
<id>urn:sha1:241b5d3ebeea21b70a74fdc8c74e73f7ed829cb1</id>
<content type='text'>
Pass the number of elements first and ther size second, as expected
by xcalloc().  Provide a semantic patch, which was actually used to
generate the rest of this patch.

The semantic patch would generate flip-flop diffs if both arguments
are sizeofs.  We don't have such a case, and it's hard to imagine
the usefulness of such an allocation.  If it ever occurs then we
could deal with it by duplicating the rule in the semantic patch to
make it cancel itself out, or we could change the code to use
CALLOC_ARRAY.

Signed-off-by: René 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 'hv/trailer-formatting'</title>
<updated>2021-03-01T22:02:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-03-01T22:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=28714238c8d482345ca17e8dd98d8cc328de24a8'/>
<id>urn:sha1:28714238c8d482345ca17e8dd98d8cc328de24a8</id>
<content type='text'>
The logic to handle "trailer" related placeholders in the
"--format=" mechanisms in the "log" family and "for-each-ref"
family is getting unified.

* hv/trailer-formatting:
  ref-filter: use pretty.c logic for trailers
  pretty.c: capture invalid trailer argument
  pretty.c: refactor trailer logic to `format_set_trailers_options()`
  t6300: use function to test trailer options
</content>
</entry>
<entry>
<title>Merge branch 'bc/signed-objects-with-both-hashes'</title>
<updated>2021-02-23T00:12:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-02-23T00:12:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=15af6e6fee54632358798bef548d89dd3764805d'/>
<id>urn:sha1:15af6e6fee54632358798bef548d89dd3764805d</id>
<content type='text'>
Signed commits and tags now allow verification of objects, whose
two object names (one in SHA-1, the other in SHA-256) are both
signed.

* bc/signed-objects-with-both-hashes:
  gpg-interface: remove other signature headers before verifying
  ref-filter: hoist signature parsing
  commit: allow parsing arbitrary buffers with headers
  gpg-interface: improve interface for parsing tags
  commit: ignore additional signatures when parsing signed commits
  ref-filter: switch some uses of unsigned long to size_t
</content>
</entry>
</feed>
