Fix smudge/clean on files that begin with a dash#1083
Merged
technoweenie merged 2 commits intogit-lfs:masterfrom Mar 18, 2016
Merged
Fix smudge/clean on files that begin with a dash#1083technoweenie merged 2 commits intogit-lfs:masterfrom
technoweenie merged 2 commits intogit-lfs:masterfrom
Conversation
added 2 commits
March 17, 2016 14:45
See issue git-lfs#1072 for details. ``` git-lfs/ $ ./test/test-unusual-filenames.sh ... test: push unusually named files ... FAILED ... [master (root-commit) 0bec008] add files 2 files changed, 1 insertion(+) create mode 100644 -dash.dat create mode 100644 .gitattributes ... Error: unknown shorthand flag: 'd' in -dash.dat ```
Fixes issue git-lfs#1072. Currently, `git-lfs` installs filters which misinterpret filenames with leading dashes as command line flags. Separate paths with a double dash (`--`) when installing filters so these files are handled properly. The failing test now passes: ``` $ ./test/test-unusual-filenames.sh ... test: push unusually named files ... OK test: pull unusually named files ... OK ```
Author
|
I'm not sure how to reproduce that test failure locally, it passes in my environment: |
Contributor
|
Hey, thanks so much for stopping by and contributing all these patches 🤘 This is the first time that the clean/smudge filters have changed. I think it'd be good to have Also, that test failure is a wonderful intermittent issue, apparently. Don't worry about it in the context of this PR: #1086 |
technoweenie
added a commit
that referenced
this pull request
Mar 18, 2016
Fix smudge/clean on files that begin with a dash
Author
|
Ah, thanks for the pointer on the test failure. Spooky! 👻 |
8 tasks
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.
Fixes #1072. Currently, the filters run a command like this when a tracked file begins with a dash:
$ git-lfs clean -filenameThe filename is then misinterpreted as short arguments.
This installs
git-lfs clean -- %finstead ofgit-lfs clean %f, and a similar smudge filter.A limitation of this patch is that existing installs don't automatically upgrade to the new filters until they run
git lfs install --force. It looks like this is consistent with thegit lfs cleanvsgit-lfs cleanprecedent, but maybe encountering this behavior is realistic enough to justify trying to build some sort of auto-upgrade feature which promotes known older variants of the filter (it looks like the pre-push hook has such a list already).In any case, this should fix new installs, and allow existing installs to use
git lfs install --forceto manually apply the fix.