Add --verify-unreachable option to LFS prune#5648
Merged
bk2204 merged 2 commits intogit-lfs:mainfrom Feb 22, 2024
Merged
Conversation
39a82b0 to
5edc1a2
Compare
LFS prune offers --verify-remote, a command that exits whenever a reachable object is not on the remote. Hence, it still prunes non-reachable objects, e.g. referenced by orphan commits. This commit adds a new option --verify-unreachable that additionally verifies those unreachable objects, so there is a guarantee that data is never lost. In addition to that, a new option --when-unverified=<halt,continue> can change the default behaviour to not exit when a file is unverified but continue to prune the verified objects.
5edc1a2 to
2be5d26
Compare
Contributor
Author
|
@bk2204 the t-credentials.sh fails on macOS and I don't know why that might happen. If I run cibuild on my mac, everything is green. Any idea? |
Member
|
That test can be a little flaky; I've marked it for rebuild. |
bk2204
approved these changes
Feb 22, 2024
chrisd8088
added a commit
to chrisd8088/git-lfs
that referenced
this pull request
May 15, 2025
In commit 2be5d26 of PR git-lfs#5648 we enhanced the "git lfs prune" command, in part by adding support for a new --when-unverified option which controls how the command behaves when the --verify-remote option is specified and an object which would otherwise be pruned is not verified as present on the current Git remote. In our git-lfs-prune(1) manual page we describe the --when-unverified option as accepting a parameter whose name we give as "<halt,continue>", with the intent that this should indicate that only the values "halt" and "continue" will be accepted for this option. However, following both our own convention and that of Git's own documentation, we generally use angle brackets around the name of a parameter to indicate that the user should substitute their own value for the argument, and then refer to that parameter by that name, with the angle brackets included. So as to make the git-lfs-prune(1) manual page more consistent with this practice, we change the name of the --when-unverified option's parameter to "<action>", and then expand the description of the option to explain the two acceptable values for that parameter, namely "halt" (the default) and "continue".
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.
This PR should close #5642
LFS prune offers
--verify-remote, a command that exits whenever a reachable object is not on the remote.Hence, it still prunes non-reachable objects, e.g. referenced by orphan commits.
This PR adds a new option
--verify-unreachablethat additionally verifies those unreachable objects, so there is a guarantee that data is never lost.In addition to that, a new option
--when-unverified=<halt,continue>can change the default behaviour to not exit when a file is unverified but continue to prune the verified objects.