elasticdog / transcrypt

transparently encrypt files within a git repository
MIT License
1.43k stars 102 forks source link

WIP Improve handling of challenging file names when 'core.quotePath=true' #80

Closed jmurty closed 4 years ago

jmurty commented 4 years ago

As described in issue #78 transcrypt could fail to properly handle:

This change improves handling of non-ASCII or space characters in filenames and adds a test to exercise and confirm the fix.

Changes in particular:

jmurty commented 4 years ago

Thanks for the feedback @elasticdog. I too am unhappy with having -c options sprinkled through the code. I have been thinking through alternatives that still fix the underlying issue, but haven't come up with any great alternatives.

Options I have considered:

  1. Forcibly set core.quotePath=false in transcrypt-enabled repositories. This would solve the problem, but in a somewhat aggressive way which might break peoples workflows or tooling. And it seems like a bad idea to override a Git default value like that unless it's really needed.

  2. Replace the sprinkled -c overrides with Git aliases which versions that include the -c core.quotePath=false override, e.g: ls-files-unquote, check-attr-unquote, ls-tree-unquote. The transcrypt script would then use these alternatives.

    This is cleaner since it sets the overrides in one place, and works okay in my initial testing except it breaks usage of transcrypt in un-inited repos for actions like transcrypt --list.