forked from git-for-windows/git
-
Notifications
You must be signed in to change notification settings - Fork 100
Fix rev index in 2.42.0 series #600
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add test case to demonstrate that `git index-pack -o <idx-path> pack-path` fails if <idx-path> does not end in ".idx" when `--rev-index` is enabled. In e37d0b8 (builtin/index-pack.c: write reverse indexes, 2021-01-25) we learned to create `.rev` reverse indexes in addition to `.idx` index files. The `.rev` file pathname is constructed by replacing the suffix on the `.idx` file. The code assumes a hard-coded "idx" suffix. In a8dd7e0 (config: enable `pack.writeReverseIndex` by default, 2023-04-12) reverse indexes were enabled by default. If the `-o <idx-path>` argument is used, the index file may have a different suffix. This causes an error when it tries to create the reverse index pathname. The test here demonstrates the failure. (The test forces `--rev-index` to avoid interaction with `GIT_TEST_NO_WRITE_REV_INDEX` during CI runs.) Signed-off-by: Jeff Hostetler <[email protected]>
Teach index-pack to silently omit the reverse index if the index file does not have the standard ".idx" suffix. In e37d0b8 (builtin/index-pack.c: write reverse indexes, 2021-01-25) we learned to create `.rev` reverse indexes in addition to `.idx` index files. The `.rev` file pathname is constructed by replacing the suffix on the `.idx` file. The code assumes a hard-coded "idx" suffix. In a8dd7e0 (config: enable `pack.writeReverseIndex` by default, 2023-04-12) reverse indexes were enabled by default. If the `-o <idx-path>` argument is used, the index file may have a different suffix. This causes an error when it tries to create the reverse index pathname. Since we do not know why the user requested a non-standard suffix for the index, we cannot guess what the proper corresponding suffix should be for the reverse index. So we disable it. The t5300 test has been updated to verify that we no longer error out and that the .rev file is not created. TODO We could warn the user that we skipped it (perhaps only if they TODO explicitly requested `--rev-index` on the command line). TODO TODO Ideally, we should add an `--rev-index-path=<path>` argument TODO or change `--rev-index` to take a pathname. TODO TODO I'll leave these questions for a future series. Signed-off-by: Jeff Hostetler <[email protected]>
vdye
approved these changes
Aug 25, 2023
dscho
approved these changes
Aug 25, 2023
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.
Looks like a solid band-aid to me.
dscho
pushed a commit
that referenced
this pull request
Nov 3, 2023
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Nov 3, 2023
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Nov 3, 2023
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Nov 3, 2023
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Nov 8, 2023
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Nov 14, 2023
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Nov 20, 2023
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
vdye
pushed a commit
that referenced
this pull request
Feb 27, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Apr 23, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Apr 23, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Apr 23, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Apr 23, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Apr 24, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Apr 29, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
May 14, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
May 14, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
May 14, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Jun 3, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Jun 3, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Jun 3, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Jul 17, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Jul 17, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Jul 17, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Jul 18, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
mjcheetham
pushed a commit
that referenced
this pull request
Jul 23, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Jul 25, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
mjcheetham
pushed a commit
that referenced
this pull request
Jul 29, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Sep 18, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Sep 24, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Oct 8, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
mjcheetham
pushed a commit
that referenced
this pull request
Dec 3, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Dec 17, 2024
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Jan 1, 2025
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Feb 10, 2025
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
Merged
dscho
pushed a commit
that referenced
this pull request
Feb 27, 2025
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
dscho
pushed a commit
that referenced
this pull request
Mar 5, 2025
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
mjcheetham
pushed a commit
that referenced
this pull request
Mar 12, 2025
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
mjcheetham
pushed a commit
that referenced
this pull request
Mar 17, 2025
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*