<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/tree-diff.c, branch v2.45.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.45.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.45.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-08-31T22:51:08Z</updated>
<entry>
<title>tree-diff: respect max_allowed_tree_depth</title>
<updated>2023-08-31T22:51:08Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2023-08-31T06:22:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b61bd18b13223064db01d89e3b8af106661efd5'/>
<id>urn:sha1:7b61bd18b13223064db01d89e3b8af106661efd5</id>
<content type='text'>
When diffing trees, we recurse to handle subtrees. That means we may run
out of stack space and segfault. Let's teach this code path about
core.maxTreeDepth in order to fail more gracefully.

As with the previous patch, we have no way to return an error (and other
tree-loading problems would just cause us to die()). So we'll likewise
call die() if we exceed the maximum depth.

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 'jc/tree-walk-drop-base-offset'</title>
<updated>2023-08-02T16:37:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-08-02T16:37:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fea92e4cac30b1204ecc8dfd53675bbdd68611e0'/>
<id>urn:sha1:fea92e4cac30b1204ecc8dfd53675bbdd68611e0</id>
<content type='text'>
Code simplification.

* jc/tree-walk-drop-base-offset:
  tree-walk: drop unused base_offset from do_match()
  tree-walk: lose base_offset that is never used in tree_entry_interesting
</content>
</entry>
<entry>
<title>tree-walk: lose base_offset that is never used in tree_entry_interesting</title>
<updated>2023-07-07T22:27:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-07-07T22:21:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0ad927e9e0013471cc752781f0c368f862934a44'/>
<id>urn:sha1:0ad927e9e0013471cc752781f0c368f862934a44</id>
<content type='text'>
The tree_entry_interesting() function takes base_offset, allowing
its callers to potentially pass a non-zero number to skip the early
part of the path string.

The feature is never exercised and we do not even know what bugs are
lurking there, as all callers pass 0 to the parameter.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff.h: remove unnecessary include of oidset.h</title>
<updated>2023-06-21T20:39:53Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-05-16T06:34:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df6e8744966bfa66ff289f58372bb060fdc6a124'/>
<id>urn:sha1:df6e8744966bfa66ff289f58372bb060fdc6a124</id>
<content type='text'>
This also made it clear that several .c files depended upon various
things that oidset included, but had omitted the direct #include for
those headers.  Add those now.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff.h: reduce unnecessary includes</title>
<updated>2023-04-24T19:47:33Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-04-22T20:17:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0e312eaa12c03043b0ef23021a5a820567ee0efd'/>
<id>urn:sha1:0e312eaa12c03043b0ef23021a5a820567ee0efd</id>
<content type='text'>
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>treewide: remove cache.h inclusion due to previous changes</title>
<updated>2023-04-24T19:47:33Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-04-22T20:17:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5e3f94dfe3c69bc2a711a9dc3b1635e7ff91ab54'/>
<id>urn:sha1:5e3f94dfe3c69bc2a711a9dc3b1635e7ff91ab54</id>
<content type='text'>
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree-diff.c: move S_DIFFTREE_IFXMIN_NEQ define from cache.h</title>
<updated>2023-04-24T19:47:32Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-04-22T20:17:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=23a517e4156714c3f8c8a4e36beccfee1d76ff1f'/>
<id>urn:sha1:23a517e4156714c3f8c8a4e36beccfee1d76ff1f</id>
<content type='text'>
S_DIFFTREE_IFXMIN_NEQ is *only* used in tree-diff.c, so there is no
point exposing it in cache.h.  Move it to tree-diff.c.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pathspec: use BUG(...) not die("BUG:%s:%d....", &lt;file&gt;, &lt;line&gt;)</title>
<updated>2021-12-07T20:31:17Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-12-07T11:05:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a78537a0f26615b69b680845cfbb765cc665c808'/>
<id>urn:sha1:a78537a0f26615b69b680845cfbb765cc665c808</id>
<content type='text'>
Change code that was added in 8f4f8f4579f (guard against new pathspec
magic in pathspec matching code, 2013-07-14) to use the BUG() macro
instead of emitting a "fatal" message with the "__FILE__"-name and
"__LINE__"-numbers.

The original code predated the existence of the BUG() function, which
was added in d8193743e08 (usage.c: add BUG() function, 2017-05-12).

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree-diff: fix leak when not HAVE_ALLOCA_H</title>
<updated>2021-09-16T20:43:42Z</updated>
<author>
<name>Carlo Marcelo Arenas Belón</name>
<email>carenas@gmail.com</email>
</author>
<published>2021-09-16T08:55:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=637799bf0ab72a509e1f2b29ee6ab3367eefbff9'/>
<id>urn:sha1:637799bf0ab72a509e1f2b29ee6ab3367eefbff9</id>
<content type='text'>
b8ba412bf7 (tree-diff: avoid alloca for large allocations, 2016-06-07)
adds a way to route some bigger allocations out of the stack and free
them through the addition of two conveniently named macros, but leaves
the calls to free the xalloca part, which could be also in the heap,
if the system doesn't HAVE_ALLOCA_H (ex: macOS and other BSD).

Add the missing free call, xalloca_free(), which is a noop if we
allocated memory in the stack frame, but a real free() if we
allocated in the heap instead, and while at it, change the expression
to match in both macros for ease of readability.

This avoids a leak reported by LSAN while running t0000 but that
wouldn't fail the test (which is fixed in the next patch):

  SUMMARY: LeakSanitizer: 1034 byte(s) leaked in 15 allocation(s).

Signed-off-by: Carlo Marcelo Arenas Belón &lt;carenas@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hash: provide per-algorithm null OIDs</title>
<updated>2021-04-27T07:31:39Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2021-04-26T01:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=14228447c9ce664a4e9c31ba10344ec5e4ea4ba5'/>
<id>urn:sha1:14228447c9ce664a4e9c31ba10344ec5e4ea4ba5</id>
<content type='text'>
Up until recently, object IDs did not have an algorithm member, only a
hash.  Consequently, it was possible to share one null (all-zeros)
object ID among all hash algorithms.  Now that we're going to be
handling objects from multiple hash algorithms, it's important to make
sure that all object IDs have a correct algorithm field.

Introduce a per-algorithm null OID, and add it to struct hash_algo.
Introduce a wrapper function as well, and use it everywhere we used to
use the null_oid constant.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
