Use gitignore-style path matching for additional commands
#4951
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.
The
lfs.fetchincludeandlfs.fetchexcludeGit configuration options, if set, are used to control the action of a number of Git LFS commands. Since PR #4556, thegit lfs clone,git lfs fetch, andgit lfs pullcommands have strictly appliedgitignore(5)-style matching rules to these configuration options.However, other commands including
git lfs filter-processandgit lfs smudgenow applygitattributes(5)-style matching rules to these same configuration options, leading to confusion.We therefore revise all remaining uses of these configuration options to also use
gitignore-style matching rules.We also add new tests for the
git lfs filter-processandgit lfs fsckcommands and adjust or expand existing tests for thegit lfs pruneandgit lfs smudgecommands in order to confirm thatgitignore-style matching is used for all of them. These new and updated tests fail ifgitattributes-style matching is used instead.As well, we update the existing manual page documentation on how these
lfs.fetch*filter configuration options function, and add additional notes on their operation with regard to several other commands, and we fix a few related formatting issues and missing references.(Note that the
git lfs migratecommand does not require any changes because it does not read thelfs.fetch*configuration options. Instead, it supplies afalsevalue for theuseFetchOptionsflag to thedetermineIncludeExcludePaths()function, so anylfs.fetch*configuration values are ignored. This is significant becausegit lfs migratedeliberately usesgitattributes-style matching for any path patterns supplied via its-I/-Xcommand-line arguments, unlike all other commands that accept-I/-Xarguments as overrides for thelfs.fetch*configuration options. See #4758 and #4751 for more details.)Fixes #4945.
/cc @nuxi as reporter.