]> git.ipfire.org Git - thirdparty/git.git/commit - commit-graph.c
commit-graph: persist existence of changed-paths
authorDerrick Stolee <dstolee@microsoft.com>
Wed, 1 Jul 2020 13:27:24 +0000 (13:27 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Jul 2020 21:17:43 +0000 (14:17 -0700)
commit0087a87ba8fc69b27dde0183ec24ade367a4aa5b
treee3c93cd6a1a15bd68d3c8c2f2d4712be275ebcf7
parent949197420e3da13c06c6a15fd4b4ed3120753c42
commit-graph: persist existence of changed-paths

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 <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-commit-graph.txt
builtin/commit-graph.c
commit-graph.c
commit-graph.h
t/t4216-log-bloom.sh