Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use commit-graph by default #50

Closed

Conversation

derrickstolee
Copy link

@derrickstolee derrickstolee commented Oct 17, 2018

The commit-graph feature is starting to stabilize. Based on what is in master right now, we have:

Git 2.18:

  • Ability to write commit-graph (requires user interaction).

  • Commit parsing is faster when commit-graph exists.

  • Must have core.commitGraph true to use.

Git 2.19:

  • Ability to write commit-graph on GC with gc.writeCommitGraph.

  • Generation numbers written in commit-graph

  • A few reachability algorithms make use of generation numbers.

(queued for) master:

  • The test suite passes with GIT_TEST_COMMIT_GRAPH=1

  • 'git commit-graph write' has progress indicators.

  • The commit-graph is automatically disabled when grafts or replace-objects exist.

There are some other things coming that are in review (like 'git log --graph' speedups), but it is probably time to consider enabling the commit-graph by default. This series does that.

For timing, I'm happy to leave this queued for a merge after the Git 2.20 release. There are enough things in master to justify not enabling this by default until that goes out and more people use it.

PATCH 3/3 is rather simple, and is the obvious thing to do to achieve enabling these config values by default.

PATCH 1/3 is a required change to make the test suite work with this change. This change isn't needed with GIT_TEST_COMMIT_GRAPH=1 because the commit-graph is up-to-date for these 'git gc' calls, so no progress is output.

PATCH 2/3 is also a necessary evil, since we already had to disable GIT_TEST_COMMIT_GRAPH for some tests, we now also need to turn off core.commitGraph.

Thanks,
-Stolee

The test script t6501-freshen-objects.sh has some tests that care
if 'git gc' has any output to stderr. This is intended to say that
no warnings occurred related to broken links. However, when we
have operations that output progress (like writing the commit-graph)
this causes the test to fail.

Use 'git gc --quiet' to avoid these progress indicators from causing
a test failure.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee
Copy link
Author

More changes are required. Everywhere in the test suite that we specify GIT_TEST_COMMIT_GRAPH=0 we need to also add -c core.commitGraph=false to ensure we don't look at the commit-graph for those steps.

There are a few tests that already require GIT_TEST_COMMIT_GRAPH=0
as they rely on an interaction with the commits in the object store
that is circumvented by parsing commit information from the
commit-graph instead. Before enabling core.commitGraph as true by
default, explicitly turn the setting off for these tests.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
The config setting "core.commitGraph" enables using the commit-graph
file to accelerate commit walks through parsing speed and generation
numbers. The setting "gc.writeCommitGraph" enables writing the
commit-graph file on every non-trivial 'git gc' operation. Together,
they help users automatically improve their performance.

By setting these config variables to true by default, we make the
commit-graph feature an "opt-out" feature instead of "opt-in".

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee
Copy link
Author

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 17, 2018

Submitted as pull.50.git.gitgitgadget@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant