<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit-graph.c, branch v2.37.3</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.37.3</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.37.3'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2022-08-11T04:52:35Z</updated>
<entry>
<title>Merge branch 'tb/commit-graph-genv2-upgrade-fix' into maint</title>
<updated>2022-08-11T04:52:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-08-11T04:52:34Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=042159a5093db5da1be2a90b7c1b88441ece6029'/>
<id>urn:sha1:042159a5093db5da1be2a90b7c1b88441ece6029</id>
<content type='text'>
There was a bug in the codepath to upgrade generation information
in commit-graph from v1 to v2 format, which has been corrected.
source: &lt;cover.1657667404.git.me@ttaylorr.com&gt;

* tb/commit-graph-genv2-upgrade-fix:
  commit-graph: fix corrupt upgrade from generation v1 to v2
  commit-graph: introduce `repo_find_commit_pos_in_graph()`
  t5318: demonstrate commit-graph generation v2 corruption
</content>
</entry>
<entry>
<title>Merge branch 'hx/lookup-commit-in-graph-fix' into maint</title>
<updated>2022-08-11T04:52:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-08-11T04:52:32Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=312d5b7429508cc339ae66e9d618b4308dd1d1e8'/>
<id>urn:sha1:312d5b7429508cc339ae66e9d618b4308dd1d1e8</id>
<content type='text'>
A corner case bug where lazily fetching objects from a promisor
remote resulted in infinite recursion has been corrected.
source: &lt;cover.1656593279.git.hanxin.hx@bytedance.com&gt;

* hx/lookup-commit-in-graph-fix:
  t5330: remove run_with_limited_processses()
  commit-graph.c: no lazy fetch in lookup_commit_in_graph()
</content>
</entry>
<entry>
<title>commit-graph: introduce `repo_find_commit_pos_in_graph()`</title>
<updated>2022-07-15T23:51:39Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-07-12T23:10:31Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7805360b7a3be02057385bc9d17aa493120b9538'/>
<id>urn:sha1:7805360b7a3be02057385bc9d17aa493120b9538</id>
<content type='text'>
Low-level callers in systems that are adjacent to the commit-graph (like
the changed-path Bloom filter code) could benefit from being able to
call a function like `parse_commit_in_graph()` without modifying the
corresponding commit slab data.

This is useful in contexts where that slab data is being used to prepare
for an upcoming commit-graph write, where Git must be careful to avoid
clobbering any of that data during a read operation.

Introduce a low-level variant of `parse_commit_in_graph()` which returns
the graph position of a given commit only, without modifying any of the
slab data.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit-graph.c: no lazy fetch in lookup_commit_in_graph()</title>
<updated>2022-07-01T06:00:32Z</updated>
<author>
<name>Han Xin</name>
<email>hanxin.hx@bytedance.com</email>
</author>
<published>2022-07-01T01:34:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=3a1ea94a491e3e0bcbc2d55b4cfb0b9eacace608'/>
<id>urn:sha1:3a1ea94a491e3e0bcbc2d55b4cfb0b9eacace608</id>
<content type='text'>
The commit-graph is used to opportunistically optimize accesses to
certain pieces of information on commit objects, and
lookup_commit_in_graph() tries to say "no" when the requested commit
does not locally exist by returning NULL, in which case the caller
can ask for (which may result in on-demand fetching from a promisor
remote) and parse the commit object itself.

However, it uses a wrong helper, repo_has_object_file(), to do so.
This helper not only checks if an object is mmediately available in
the local object store, but also tries to fetch from a promisor remote.
But the fetch machinery calls lookup_commit_in_graph(), thus causing an
infinite loop.

We should make lookup_commit_in_graph() expect that a commit given to it
can be legitimately missing from the local object store, by using the
has_object_file() helper instead.

Signed-off-by: Han Xin &lt;hanxin.hx@bytedance.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tb/cruft-packs'</title>
<updated>2022-06-03T21:30:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-06-03T21:30:37Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=a50036da1a39806a8ae1aba2e2f2fea6f7fb8e08'/>
<id>urn:sha1:a50036da1a39806a8ae1aba2e2f2fea6f7fb8e08</id>
<content type='text'>
A mechanism to pack unreachable objects into a "cruft pack",
instead of ejecting them into loose form to be reclaimed later, has
been introduced.

* tb/cruft-packs:
  sha1-file.c: don't freshen cruft packs
  builtin/gc.c: conditionally avoid pruning objects via loose
  builtin/repack.c: add cruft packs to MIDX during geometric repack
  builtin/repack.c: use named flags for existing_packs
  builtin/repack.c: allow configuring cruft pack generation
  builtin/repack.c: support generating a cruft pack
  builtin/pack-objects.c: --cruft with expiration
  reachable: report precise timestamps from objects in cruft packs
  reachable: add options to add_unseen_recent_objects_to_traversal
  builtin/pack-objects.c: --cruft without expiration
  builtin/pack-objects.c: return from create_object_entry()
  t/helper: add 'pack-mtimes' test-tool
  pack-mtimes: support writing pack .mtimes files
  chunk-format.h: extract oid_version()
  pack-write: pass 'struct packing_data' to 'stage_tmp_packfiles'
  pack-mtimes: support reading .mtimes files
  Documentation/technical: add cruft-packs.txt
</content>
</entry>
<entry>
<title>chunk-format.h: extract oid_version()</title>
<updated>2022-05-26T22:48:26Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2022-05-20T23:17:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d9fef9d90d27b6794350ec3bc622042b79397088'/>
<id>urn:sha1:d9fef9d90d27b6794350ec3bc622042b79397088</id>
<content type='text'>
There are three definitions of an identical function which converts
`the_hash_algo` into either 1 (for SHA-1) or 2 (for SHA-256). There is a
copy of this function for writing both the commit-graph and
multi-pack-index file, and another inline definition used to write the
.rev header.

Consolidate these into a single definition in chunk-format.h. It's not
clear that this is the best header to define this function in, but it
should do for now.

(Worth noting, the .rev caller expects a 4-byte unsigned, but the other
two callers work with a single unsigned byte. The consolidated version
uses the latter type, and lets the compiler widen it when required).

Another caller will be added in a subsequent patch.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/valgrind-fixes'</title>
<updated>2022-05-23T21:39:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-23T21:39:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e'/>
<id>urn:sha1:1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e</id>
<content type='text'>
A bit of test framework fixes with a few fixes to issues found by
valgrind.

* ab/valgrind-fixes:
  commit-graph.c: don't assume that stat() succeeds
  object-file: fix a unpack_loose_header() regression in 3b6a8db3b03
  log test: skip a failing mkstemp() test under valgrind
  tests: using custom GIT_EXEC_PATH breaks --valgrind tests
</content>
</entry>
<entry>
<title>Merge branch 'ep/maint-equals-null-cocci'</title>
<updated>2022-05-20T22:26:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-20T22:26:59Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=538dc459a0331c48b893c9f6ca0be5917860bb99'/>
<id>urn:sha1:538dc459a0331c48b893c9f6ca0be5917860bb99</id>
<content type='text'>
Introduce and apply coccinelle rule to discourage an explicit
comparison between a pointer and NULL, and applies the clean-up to
the maintenance track.

* ep/maint-equals-null-cocci:
  tree-wide: apply equals-null.cocci
  tree-wide: apply equals-null.cocci
  contrib/coccinnelle: add equals-null.cocci
</content>
</entry>
<entry>
<title>commit-graph.c: don't assume that stat() succeeds</title>
<updated>2022-05-12T22:42:26Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-05-12T22:32:17Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7c898554d7a80e5d70ee8816a23dc425d2f1729c'/>
<id>urn:sha1:7c898554d7a80e5d70ee8816a23dc425d2f1729c</id>
<content type='text'>
Fix code added in 8d84097f965 (commit-graph: expire commit-graph
files, 2019-06-18) to check the return value of the stat() system
call. Not doing so caused us to use uninitialized memory in the "Bloom
generation is limited by --max-new-filters" test in
t4216-log-bloom.sh:

	+ rm -f trace.event
	+ pwd
	+ GIT_TRACE2_EVENT=[...]/t/trash directory.t4216-log-bloom/limits/trace.event git commit-graph write --reachable --split=replace --changed-paths --max-new-filters=2
	==24835== Syscall param utimensat(times[0].tv_sec) points to uninitialised byte(s)
	==24835==    at 0x499E65A: __utimensat64_helper (utimensat.c:34)
	==24835==    by 0x4999142: utime (utime.c:36)
	==24835==    by 0x552BE0: mark_commit_graphs (commit-graph.c:2213)
	==24835==    by 0x550822: write_commit_graph (commit-graph.c:2424)
	==24835==    by 0x54E3A0: write_commit_graph_reachable (commit-graph.c:1681)
	==24835==    by 0x4374BB: graph_write (commit-graph.c:269)
	==24835==    by 0x436F7D: cmd_commit_graph (commit-graph.c:326)
	==24835==    by 0x407B9A: run_builtin (git.c:465)
	==24835==    by 0x406651: handle_builtin (git.c:719)
	==24835==    by 0x407575: run_argv (git.c:786)
	==24835==    by 0x406410: cmd_main (git.c:917)
	==24835==    by 0x511F09: main (common-main.c:56)
	==24835==  Address 0x1ffeffde70 is on thread 1's stack
	==24835==  in frame #1, created by utime (utime.c:25)
	==24835==  Uninitialised value was created by a stack allocation
	==24835==    at 0x552B50: mark_commit_graphs (commit-graph.c:2201)
	==24835==
	[...]
	error: last command exited with $?=126
	not ok 137 - Bloom generation is limited by --max-new-filters

This would happen as we stat'd the non-existing
".git/objects/info/commit-graph" file. Let's fix mark_commit_graphs()
to check the stat()'s return value, and while we're at it fix another
case added in the same commit to do the same.

The caller in expire_commit_graphs() would have been less likely to
run into this, as it's operating on files it just got from readdir(),
but it could still happen due to a race with e.g. a concurrent "rm
-rf" of the commit-graph files.

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>Merge branch 'ep/maint-equals-null-cocci' for maint-2.35</title>
<updated>2022-05-02T17:06:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-02T17:06:00Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2b0a58d164b0642be3eeb476fecd28114445cdd5'/>
<id>urn:sha1:2b0a58d164b0642be3eeb476fecd28114445cdd5</id>
<content type='text'>
* ep/maint-equals-null-cocci:
  tree-wide: apply equals-null.cocci
  contrib/coccinnelle: add equals-null.cocci
</content>
</entry>
</feed>
