<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/commit-graph.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-01-06T23:10:49Z</updated>
<entry>
<title>builtin/*: update usage format</title>
<updated>2021-01-06T23:10:49Z</updated>
<author>
<name>ZheNing Hu</name>
<email>adlternative@gmail.com</email>
</author>
<published>2021-01-06T14:44:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e73fe3dd028ad830bb44b3ad7de15901834e557f'/>
<id>urn:sha1:e73fe3dd028ad830bb44b3ad7de15901834e557f</id>
<content type='text'>
According to the guidelines in parse-options.h,
we should not end in a full stop or start with
a capital letter. Fix old error and usage
messages to match this expectation.

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>assert PARSE_OPT_NONEG in parse-options callbacks</title>
<updated>2020-09-30T19:53:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-09-30T12:29:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d2aa8dfac4048c964453a8983f1dc12ecdfe1c3'/>
<id>urn:sha1:8d2aa8dfac4048c964453a8983f1dc12ecdfe1c3</id>
<content type='text'>
In the spirit of 517fe807d6 (assert NOARG/NONEG behavior of
parse-options callbacks, 2018-11-05), let's cover some parse-options
callbacks which expect to be used with PARSE_OPT_NONEG but don't
explicitly assert that this is the case. These callbacks are all used
correctly in the current code, but this will help document their
expectations and future-proof the code.

As a bonus, it also silences -Wunused-parameters (these were added since
the initial sweep of 517fe807d6, and we can't yet turn on
-Wunused-parameters to remind people because it has too many existing
false positives).

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>commit-graph: introduce 'commitGraph.maxNewFilters'</title>
<updated>2020-09-18T17:39:22Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2020-09-18T02:59:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d356d5debe56b1e43b5ca674c662a08f25176f05'/>
<id>urn:sha1:d356d5debe56b1e43b5ca674c662a08f25176f05</id>
<content type='text'>
Introduce a configuration variable to specify a default value for the
recently-introduce '--max-new-filters' option of 'git commit-graph
write'.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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>builtin/commit-graph.c: introduce '--max-new-filters=&lt;n&gt;'</title>
<updated>2020-09-18T17:35:39Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2020-09-18T13:27:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=809e0327f579267ea78a1b2f727d3b63c1f5d044'/>
<id>urn:sha1:809e0327f579267ea78a1b2f727d3b63c1f5d044</id>
<content type='text'>
Introduce a command-line flag to specify the maximum number of new Bloom
filters that a 'git commit-graph write' is willing to compute from
scratch.

Prior to this patch, a commit-graph write with '--changed-paths' would
compute Bloom filters for all selected commits which haven't already
been computed (i.e., by a previous commit-graph write with '--split'
such that a roll-up or replacement is performed).

This behavior can cause prohibitively-long commit-graph writes for a
variety of reasons:

  * There may be lots of filters whose diffs take a long time to
    generate (for example, they have close to the maximum number of
    changes, diffing itself takes a long time, etc).

  * Old-style commit-graphs (which encode filters with too many entries
    as not having been computed at all) cause us to waste time
    recomputing filters that appear to have not been computed only to
    discover that they are too-large.

This can make the upper-bound of the time it takes for 'git commit-graph
write --changed-paths' to be rather unpredictable.

To make this command behave more predictably, introduce
'--max-new-filters=&lt;n&gt;' to allow computing at most '&lt;n&gt;' Bloom filters
from scratch. This lets "computing" already-known filters proceed
quickly, while bounding the number of slow tasks that Git is willing to
do.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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: rename 'split_commit_graph_opts'</title>
<updated>2020-09-18T04:55:50Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2020-09-18T02:59:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98bb796191f7234c88b7a97f587d37ffbd130289'/>
<id>urn:sha1:98bb796191f7234c88b7a97f587d37ffbd130289</id>
<content type='text'>
In the subsequent commit, additional options will be added to the
commit-graph API which have nothing to do with splitting.

Rename the 'split_commit_graph_opts' structure to the more-generic
'commit_graph_opts' to encompass both. Likewise, rename the 'flags'
member to instead be 'split_flags' to clarify that it only has to do
with the behavior implied by '--split'.

Suggested-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
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: pass a 'struct repository *' in more places</title>
<updated>2020-09-09T19:51:48Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2020-09-09T15:22:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ab14d0676c58389e6f0ccbb9569b07045a05b6df'/>
<id>urn:sha1:ab14d0676c58389e6f0ccbb9569b07045a05b6df</id>
<content type='text'>
In a future commit, some commit-graph internals will want access to
'r-&gt;settings', but we only have the 'struct object_directory *'
corresponding to that repository.

Add an additional parameter to pass the repository around in more
places.

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 'ds/commit-graph-bloom-updates' into master</title>
<updated>2020-07-30T20:20:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-07-30T20:20:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=70cdbbe3a7028b9c1eb7542a0aa038b971d3fb27'/>
<id>urn:sha1:70cdbbe3a7028b9c1eb7542a0aa038b971d3fb27</id>
<content type='text'>
Updates to the changed-paths bloom filter.

* ds/commit-graph-bloom-updates:
  commit-graph: check all leading directories in changed path Bloom filters
  revision: empty pathspecs should not use Bloom filters
  revision.c: fix whitespace
  commit-graph: check chunk sizes after writing
  commit-graph: simplify chunk writes into loop
  commit-graph: unify the signatures of all write_graph_chunk_*() functions
  commit-graph: persist existence of changed-paths
  bloom: fix logic in get_bloom_filter()
  commit-graph: change test to die on parse, not load
  commit-graph: place bloom_settings in context
</content>
</entry>
<entry>
<title>Merge branch 'tb/commit-graph-no-check-oids' into master</title>
<updated>2020-07-15T23:29:45Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-07-15T23:29:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d1ae8ba0963378f6613bfd683a969a94ca01b344'/>
<id>urn:sha1:d1ae8ba0963378f6613bfd683a969a94ca01b344</id>
<content type='text'>
Fix to the code to produce progress bar, which is new in the
upcoming release.

* tb/commit-graph-no-check-oids:
  commit-graph: fix "Collecting commits from input" progress line
</content>
</entry>
<entry>
<title>commit-graph: fix "Collecting commits from input" progress line</title>
<updated>2020-07-15T18:57:19Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2020-07-10T19:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=862aead24eaf797860fb503561a1f86adf557abb'/>
<id>urn:sha1:862aead24eaf797860fb503561a1f86adf557abb</id>
<content type='text'>
To display a progress line while reading commits from standard input
and looking them up, 5b6653e523 (builtin/commit-graph.c: dereference
tags in builtin, 2020-05-13) should have added a pair of
start_delayed_progress() and stop_progress() calls around the loop
reading stdin.  Alas, the stop_progress() call ended up at the wrong
place, after write_commit_graph(), which does all the commit-graph
computation and writing, and has several progress lines of its own.
Consequently, that new

  Collecting commits from input: 1234

progress line is overwritten by the first progress line shown by
write_commit_graph(), and its final "done" line is shown last, after
everything is finished:

  $ { sleep 3 ; git rev-list -3 HEAD ; sleep 1 ; } | ~/src/git/git commit-graph write --stdin-commits
  Expanding reachable commits in commit graph: 873402, done.
  Writing out commit graph in 4 passes: 100% (3493608/3493608), done.
  Collecting commits from input: 3, done.

Furthermore, that stop_progress() call was added after the 'cleanup'
label, where that loop reading stdin jumps in case of an error.  In
case of invalid input this then results in the "done" line shown after
the error message:

  $ { sleep 3 ; git rev-list -3 HEAD ; echo junk ; } | ~/src/git/git commit-graph write --stdin-commits
  error: unexpected non-hex object ID: junk
  Collecting commits from input: 3, done.

Move that stop_progress() call to the right place.

While at it, drop the unnecessary 'if (progress)' condition protecting
the stop_progress() call, because that function is prepared to handle
a NULL progress struct.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Reviewed-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit-graph: persist existence of changed-paths</title>
<updated>2020-07-01T21:17:43Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2020-07-01T13:27:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0087a87ba8fc69b27dde0183ec24ade367a4aa5b'/>
<id>urn:sha1:0087a87ba8fc69b27dde0183ec24ade367a4aa5b</id>
<content type='text'>
The changed-path Bloom filters were released in v2.27.0, but have a
significant drawback. A user can opt-in to writing the changed-path
filters using the "--changed-paths" option to "git commit-graph write"
but the next write will drop the filters unless that option is
specified.

This becomes even more important when considering the interaction with
gc.writeCommitGraph (on by default) or fetch.writeCommitGraph (part of
features.experimental). These config options trigger commit-graph writes
that the user did not signal, and hence there is no --changed-paths
option available.

Allow a user that opts-in to the changed-path filters to persist the
property of "my commit-graph has changed-path filters" automatically. A
user can drop filters using the --no-changed-paths option.

In the process, we need to be extremely careful to match the Bloom
filter settings as specified by the commit-graph. This will allow future
versions of Git to customize these settings, and the version with this
change will persist those settings as commit-graphs are rewritten on
top.

Use the trace2 API to signal the settings used during the write, and
check that output in a test after manually adjusting the correct bytes
in the commit-graph file.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
