Fix rev index in 2.42.0 series#600
Merged
jeffhostetler merged 2 commits intovfs-2.42.0from Aug 29, 2023
Merged
Conversation
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 <jeffhostetler@github.com>
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 <jeffhostetler@github.com>
vdye
approved these changes
Aug 25, 2023
dscho
approved these changes
Aug 25, 2023
Member
dscho
left a comment
There was a problem hiding this comment.
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.*
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.*
dscho
pushed a commit
that referenced
this pull request
Jun 6, 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
Jun 11, 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
Jun 16, 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
Jun 16, 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
Jul 8, 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
Aug 5, 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
Aug 8, 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
Aug 13, 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
Aug 19, 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
Oct 17, 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
Oct 17, 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
Oct 28, 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
Nov 5, 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
Nov 6, 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
Nov 13, 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
Nov 17, 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
Jan 27, 2026
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 28, 2026
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 31, 2026
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 3, 2026
Cherry-pick rev-index fixes from v2.41.0.vfs.0.5 into v2.42.0.*
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
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.*