<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit-graph.c, branch gitk-resize-error</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=gitk-resize-error</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=gitk-resize-error'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2021-12-06T17:55:05Z</updated>
<entry>
<title>commit-graph: return if there is no git directory</title>
<updated>2021-12-06T17:55:05Z</updated>
<author>
<name>Lessley Dennington</name>
<email>lessleydennington@gmail.com</email>
</author>
<published>2021-12-06T15:55:56Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=0803f9c7cdff63d0c6cb992ba90f53fdcae50869'/>
<id>urn:sha1:0803f9c7cdff63d0c6cb992ba90f53fdcae50869</id>
<content type='text'>
Return early if git directory does not exist. This will protect against
test failures in the upcoming change to BUG in prepare_repo_settings if no
git directory exists.

Signed-off-by: Lessley Dennington &lt;lessleydennington@gmail.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/run-command-close-packs'</title>
<updated>2021-09-20T22:20:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-20T22:20:45Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c042ad5ad58d4e43aadc806850e76fef73848d2c'/>
<id>urn:sha1:c042ad5ad58d4e43aadc806850e76fef73848d2c</id>
<content type='text'>
The run-command API has been updated so that the callers can easily
ask the file descriptors open for packfiles to be closed immediately
before spawning commands that may trigger auto-gc.

* js/run-command-close-packs:
  Close object store closer to spawning child processes
  run_auto_maintenance(): implicitly close the object store
  run-command: offer to close the object store before running
  run-command: prettify the `RUN_COMMAND_*` flags
  pull: release packs before fetching
  commit-graph: when closing the graph, also release the slab
</content>
</entry>
<entry>
<title>Merge branch 'ab/progress-users-adjust-counters'</title>
<updated>2021-09-20T22:20:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-20T22:20:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=df0c308c1a165e277ef3a7b8ae1457b926936d99'/>
<id>urn:sha1:df0c308c1a165e277ef3a7b8ae1457b926936d99</id>
<content type='text'>
The code to show progress indicator in a few code paths did not
cover between 0-100%, which has been corrected.

* ab/progress-users-adjust-counters:
  entry: show finer-grained counter in "Filtering content" progress line
  commit-graph: fix bogus counter in "Scanning merged commits" progress line
</content>
</entry>
<entry>
<title>commit-graph: fix bogus counter in "Scanning merged commits" progress line</title>
<updated>2021-09-09T16:58:19Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2021-09-09T01:10:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=4011224944bf5dc6f38bce55edd5b4092ac0c930'/>
<id>urn:sha1:4011224944bf5dc6f38bce55edd5b4092ac0c930</id>
<content type='text'>
The final value of the counter of the "Scanning merged commits"
progress line is always one less than its expected total, e.g.:

  Scanning merged commits:  83% (5/6), done.

This happens because while iterating over an array the loop variable
is passed to display_progress() as-is, but while C arrays (and thus
the loop variable) start at 0 and end at N-1, the progress counter
must end at N. Fix this by passing 'i + 1' to display_progress(), like
most other callsites do.

There's an RFC series to add a GIT_TEST_CHECK_PROGRESS=1 mode[1] which
catches this issue in the 'fetch.writeCommitGraph' and
'fetch.writeCommitGraph with submodules' tests in
't5510-fetch.sh'. The GIT_TEST_CHECK_PROGRESS=1 mode is not part of
this series, but future changes to progress.c may add it or similar
assertions to catch this and similar bugs elsewhere.

1. https://lore.kernel.org/git/20210620200303.2328957-1-szeder.dev@gmail.com/

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.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>commit-graph: when closing the graph, also release the slab</title>
<updated>2021-09-08T19:17:14Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2021-09-08T08:29:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=957ba814bf93b698742ffa3cf37e4f665ed95b45'/>
<id>urn:sha1:957ba814bf93b698742ffa3cf37e4f665ed95b45</id>
<content type='text'>
The slab has information about the commit graph. That means that it is
meaningless (and even misleading) when the commit graph was closed.

This seems not to matter currently, but we're about to fix a
Windows-specific bug where `git pull` does not close the object store
before fetching (risking that an implicit auto-gc fails to remove the
now-obsolete pack file(s)), and once we have that bug fix in place, it
does matter: after that bug fix, we will open the object store, do some
stuff with it, then close it, fetch, and then open it again, and do more
stuff. If we close the commit graph without releasing the corresponding
slab, we're hit by a symptom like this in t5520.19:

	BUG: commit-reach.c:85: bad generation skip 9223372036854775807
	&gt; 3 at 5cd378271655d43a3b4477520014f02213ad1546

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>revision: avoid hitting packfiles when commits are in commit-graph</title>
<updated>2021-08-09T16:51:12Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2021-08-09T08:12:03Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f559d6d45e7e58ae1f922213948723de77ea77bd'/>
<id>urn:sha1:f559d6d45e7e58ae1f922213948723de77ea77bd</id>
<content type='text'>
When queueing references in git-rev-list(1), we try to optimize parsing
of commits via the commit-graph. To do so, we first look up the object's
type, and if it is a commit we call `repo_parse_commit()` instead of
`parse_object()`. This is quite inefficient though given that we're
always uncompressing the object header in order to determine the type.
Instead, we can opportunistically search the commit-graph for the object
ID: in case it's found, we know it's a commit and can directly fill in
the commit object without having to uncompress the object header.

Expose a new function `lookup_commit_in_graph()`, which tries to find a
commit in the commit-graph by ID, and convert `get_reference()` to use
this function. This provides a big performance win in cases where we
load references in a repository with lots of references pointing to
commits. The following has been executed in a real-world repository with
about 2.2 million refs:

    Benchmark #1: HEAD~: rev-list --unsorted-input --objects --quiet --not --all --not $newrev
      Time (mean ± σ):      4.458 s ±  0.044 s    [User: 4.115 s, System: 0.342 s]
      Range (min … max):    4.409 s …  4.534 s    10 runs

    Benchmark #2: HEAD: rev-list --unsorted-input --objects --quiet --not --all --not $newrev
      Time (mean ± σ):      3.089 s ±  0.015 s    [User: 2.768 s, System: 0.321 s]
      Range (min … max):    3.061 s …  3.105 s    10 runs

    Summary
      'HEAD: rev-list --unsorted-input --objects --quiet --not --all --not $newrev' ran
        1.44 ± 0.02 times faster than 'HEAD~: rev-list --unsorted-input --objects --quiet --not --all --not $newrev'

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit-graph: split out function to search commit position</title>
<updated>2021-08-09T16:51:12Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2021-08-09T08:11:59Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=809ea28f809e52d3204b597637b2f5e072c140f8'/>
<id>urn:sha1:809ea28f809e52d3204b597637b2f5e072c140f8</id>
<content type='text'>
The function `find_commit_in_graph()` assumes that the caller has passed
an object which was already determined to be a commit given that it will
access the commit's graph position, which is stored in a commit slab. In
a subsequent patch, we want to search for an object ID though without
knowing whether it is a commit or not, which is not currently possible.

Split out the logic to search the commit graph for a given object ID to
prepare for this change. This commit also renames the function to
`find_commit_pos_in_graph()`, which more accurately reflects what this
function does. Furthermore, in order to allow for the searched object ID
to be const, we need to adjust `bsearch_graph()`'s signature to accept a
constant object ID as input, too.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/attribute-format'</title>
<updated>2021-07-28T20:17:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-07-28T20:17:59Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=dd6d3c90eeff56770f2f4b88fb61cc44bf01d890'/>
<id>urn:sha1:dd6d3c90eeff56770f2f4b88fb61cc44bf01d890</id>
<content type='text'>
Many "printf"-like helper functions we have have been annotated
with __attribute__() to catch placeholder/parameter mismatches.

* ab/attribute-format:
  advice.h: add missing __attribute__((format)) &amp; fix usage
  *.h: add a few missing __attribute__((format))
  *.c static functions: add missing __attribute__((format))
  sequencer.c: move static function to avoid forward decl
  *.c static functions: don't forward-declare __attribute__
</content>
</entry>
<entry>
<title>*.c static functions: add missing __attribute__((format))</title>
<updated>2021-07-13T22:20:20Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-07-13T08:05:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=48ca53cac4a5bee2dee3a5f3d6550753bf696d28'/>
<id>urn:sha1:48ca53cac4a5bee2dee3a5f3d6550753bf696d28</id>
<content type='text'>
Add missing __attribute__((format)) function attributes to various
"static" functions that take printf arguments.

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>commit-graph: rewrite to use checksum_valid()</title>
<updated>2021-06-29T03:36:17Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2021-06-23T18:39:09Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=15316a4732eeb0dab27ba406cb80e8704cb9b46d'/>
<id>urn:sha1:15316a4732eeb0dab27ba406cb80e8704cb9b46d</id>
<content type='text'>
Rewrite an existing caller in `git commit-graph verify` to take
advantage of checksum_valid().

Note that the replacement isn't a verbatim cut-and-paste, since the new
function avoids using hashfile at all and instead talks to the_hash_algo
directly, but it is functionally equivalent.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
