-
Notifications
You must be signed in to change notification settings - Fork 133
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
Sparse Index: diff and blame builtins #1050
Sparse Index: diff and blame builtins #1050
Conversation
Welcome to GitGitGadgetHi @ldennington, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests. Please make sure that your Pull Request has a good description, as it will be used as cover letter. Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:
It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code. Contributing the patchesBefore you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form Both the person who commented An alternative is the channel
Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment If you want to see what email(s) would be sent for a After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to reply via mail). If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the Git mailing list archive (click the curl -g --user "<EMailAddress>:<Password>" \
--url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt To iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description):
To send a new iteration, just add another PR comment with the contents: Need help?New contributors who want advice are encouraged to join git-mentoring@googlegroups.com, where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join. You may also be able to find help in real time in the developer IRC channel, |
/allow |
User ldennington is now allowed to use GitGitGadget. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8aca481
to
506e41b
Compare
506e41b
to
1808f7a
Compare
1808f7a
to
0f2a0ce
Compare
/preview |
Preview email sent as pull.1050.git.1634155628.gitgitgadget@gmail.com |
3f0a15b
to
6b0bccd
Compare
/preview |
Preview email sent as pull.1050.git.1634229968.gitgitgadget@gmail.com |
6b0bccd
to
ddcee00
Compare
/submit |
HttpError: Server Error |
While the PR handler did something strange with the error message, your patches were emailed: https://lore.kernel.org/git/pull.1050.git.1634232352.gitgitgadget@gmail.com/ |
Here is where that error comes from: https://dev.azure.com/gitgitgadget/git/_build/results?buildId=112911&view=logs&j=fd490c07-0b22-5182-fac9-6d67fe1e939b&t=28e14b79-1d95-5195-ee03-3a68ac48a418&l=26. The comment should have read thusly:
|
Thanks! I will admit I saw it and panicked but then realized the series had made it through and un-panicked 🙂. |
This branch is now known as |
This patch series was integrated into seen via git@8ce48c2. |
There was a status update in the "New Topics" section about the branch Teach diff and blame to work well with sparse index. Seems to break tests (e.g. 1092) when merged to 'seen'. |
Hrm. @ldennington have you seen this? |
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 <lessleydennington@gmail.com> Reviewed-by: Elijah Newren <newren@gmail.com>
Move repo setup to occur after git directory is set up. 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 <lessleydennington@gmail.com> Reviewed-by: Elijah Newren <newren@gmail.com>
Check whether git directory exists before adding any repo settings. If it does not exist, BUG with the message that one cannot add settings for an uninitialized repository. If it does exist, proceed with adding repo settings. Signed-off-by: Lessley Dennington <lessleydennington@gmail.com> Reviewed-by: Elijah Newren <newren@gmail.com>
Replace uses of the synonym --staged in t1092 tests with --cached (which is the real and preferred option). This will allow consistency in the new tests to be added with the upcoming change to enable the sparse index for diff. Signed-off-by: Lessley Dennington <lessleydennington@gmail.com> Reviewed-by: Elijah Newren <newren@gmail.com>
Enable the sparse index within the 'git diff' command. Its implementation already safely integrates with the sparse index because it shares code with the 'git status' and 'git checkout' commands that were already integrated. For more details see: d76723e (status: use sparse-index throughout, 2021-07-14) 1ba5f45 (checkout: stop expanding sparse indexes, 2021-06-29) The most interesting thing to do is to add tests that verify that 'git diff' behaves correctly when the sparse index is enabled. These cases are: 1. The index is not expanded for 'diff' and 'diff --staged' 2. 'diff' and 'diff --staged' behave the same in full checkout, sparse checkout, and sparse index repositories in the following partially-staged scenarios (i.e. the index, HEAD, and working directory differ at a given path): 1. Path is within sparse-checkout cone 2. Path is outside sparse-checkout cone 3. A merge conflict exists for paths outside sparse-checkout cone The `p2000` tests demonstrate a ~44% execution time reduction for 'git diff' and a ~86% execution time reduction for 'git diff --staged' using a sparse index: Test before after ------------------------------------------------------------- 2000.30: git diff (full-v3) 0.33 0.34 +3.0% 2000.31: git diff (full-v4) 0.33 0.35 +6.1% 2000.32: git diff (sparse-v3) 0.53 0.31 -41.5% 2000.33: git diff (sparse-v4) 0.54 0.29 -46.3% 2000.34: git diff --cached (full-v3) 0.07 0.07 +0.0% 2000.35: git diff --cached (full-v4) 0.07 0.08 +14.3% 2000.36: git diff --cached (sparse-v3) 0.28 0.04 -85.7% 2000.37: git diff --cached (sparse-v4) 0.23 0.03 -87.0% Co-authored-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Lessley Dennington <lessleydennington@gmail.com> Reviewed-by: Elijah Newren <newren@gmail.com>
Enable the sparse index for the 'git blame' command. The index was already not expanded with this command, so the most interesting thing to do is to add tests that verify that 'git blame' behaves correctly when the sparse index is enabled and that its performance improves. More specifically, these cases are: 1. The index is not expanded for 'blame' when given paths in the sparse checkout cone at multiple levels. 2. Performance measurably improves for 'blame' with sparse index when given paths in the sparse checkout cone at multiple levels. The `p2000` tests demonstrate a ~60% execution time reduction when running 'blame' for a file two levels deep and and a ~30% execution time reduction for a file three levels deep. Test before after ---------------------------------------------------------------- 2000.62: git blame f2/f4/a (full-v3) 0.31 0.32 +3.2% 2000.63: git blame f2/f4/a (full-v4) 0.29 0.31 +6.9% 2000.64: git blame f2/f4/a (sparse-v3) 0.55 0.23 -58.2% 2000.65: git blame f2/f4/a (sparse-v4) 0.57 0.23 -59.6% 2000.66: git blame f2/f4/f3/a (full-v3) 0.77 0.85 +10.4% 2000.67: git blame f2/f4/f3/a (full-v4) 0.78 0.81 +3.8% 2000.68: git blame f2/f4/f3/a (sparse-v3) 1.07 0.72 -32.7% 2000.99: git blame f2/f4/f3/a (sparse-v4) 1.05 0.73 -30.5% We do not include paths outside the sparse checkout cone because blame does not support blaming files that are not present in the working directory. This is true in both sparse and full checkouts. Signed-off-by: Lessley Dennington <lessleydennington@gmail.com> Reviewed-by: Elijah Newren <newren@gmail.com>
27732a4
to
85bcbaa
Compare
/submit |
Submitted as pull.1050.v6.git.1638806161.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
This patch series was integrated into seen via git@f07b0fe. |
This patch series was integrated into seen via git@8e8ef40. |
This patch series was integrated into seen via git@fd11ee3. |
This patch series was integrated into seen via git@f25d949. |
There was a status update in the "Cooking" section about the branch Teach diff and blame to work well with sparse index. Will merge to 'next'? source: <pull.1050.v6.git.1638806161.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@83f9bb2. |
This patch series was integrated into seen via git@2b3bd97. |
This patch series was integrated into seen via git@413027d. |
There was a status update in the "Cooking" section about the branch Teach diff and blame to work well with sparse index. Will merge to 'master'. source: <pull.1050.v6.git.1638806161.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@ce2086f. |
This patch series was integrated into next via git@57b8993. |
This patch series was integrated into seen via git@2384e12. |
This patch series was integrated into seen via git@f874499. |
There was a status update in the "Cooking" section about the branch Teach diff and blame to work well with sparse index. Will merge to 'master'. source: <pull.1050.v6.git.1638806161.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@8d2c373. |
This patch series was integrated into next via git@8d2c373. |
This patch series was integrated into master via git@8d2c373. |
Closed via 8d2c373. |
This series is based on vd/sparse-reset. It integrates the sparse index with
git diff
andgit blame
and includes:t1092
andp2000
to establish the baseline functionality of the commandsThe
p2000
tests demonstrate a ~44% execution time reduction for 'git diff' and a ~86% execution time reduction for 'git diff --staged' using a sparse index. For 'git blame', the reduction time was ~60% for a file two levels deep and ~30% for a file three levels deep.Changes since V1
diff partially-staged
test int1092-sparse-checkout-compatibility.sh
, which was breaking inseen
.Changes since V2
diff
commit description to include patches that make thecheckout
andstatus
commands work with the sparse index for readers to reference.diff
behaves as expected when run against files outside the sparse checkout cone.blame
commitblame with pathspec outside sparse definition
test matches expectations.blame
tests (instead of running the same command multiple time against different files).Changes since V3
diff
p2000 tests to use--cached
instead of--staged
. Execute new run and update results in commit description and cover letter.blame with pathspec outside sparse definition
test int1092-sparse-checkout-compatibility.sh
to clarify that it tests the current state and could be improved in the future.diff
is running against files in a Git repo.BUG
ifprepare_repo_settings()
is called outside a repository.blame
,checkout
, orpack-object
with-h
.commit-graph
is only loaded if a git directory exists.Changes since V4
checkout
,pack-objects
, andblame
. Updategit.c
to no longer bypass setup when-h
is passed instead.commit-graph
,test-read-cache
, andrepo-settings
changes into their own patches with details in commit description of why the changes are being made.t1092-sparse-checkout-compatibility.sh
tests to use--cached
instead of--staged
.diff
commit message.blame with pathspec outside sparse definition
test int1092-sparse-checkout-compatibility.sh
andblame
commit message.Changes since V5
run_builtin
.prefix
NULL assignment inrun_builtin
.Thanks,
Lessley
cc: stolee@gmail.com
cc: gitster@pobox.com
cc: newren@gmail.com
cc: Taylor Blau me@ttaylorr.com