xltrail / git-xl

Git extension: Makes git-diff work for VBA in Excel workbooks (xls* file types)
https://www.xltrail.com/git-xl
MIT License
559 stars 72 forks source link

Install breaks if ~ in core.excludesfile #44

Closed ovidner closed 5 years ago

ovidner commented 5 years ago

Steps to reproduce:

  1. Use Windows. (This step might not be mandatory)
  2. Store your global ignores in e.g. ~/.gitignore_global.
  3. Point to your global ignores using core.excludesfile=~/.gitignore_global in git config. The tilde is the important part here.
  4. Run git xl install.

Expected behaviour

Installations succeeds. :)

Actual behaviour

[...] Failed to execute script cli
Traceback (most recent call last):
  File "cli.py", line 344, in <module>
  File "cli.py", line 260, in execute
  File "cli.py", line 295, in install
  File "cli.py", line 82, in install
  File "cli.py", line 176, in update_git_file
FileNotFoundError: [Errno 2] No such file or directory: '~/.gitignore_global'

Possible cause

  1. https://github.com/xlwings/git-xl/blob/master/src/cli.py#L176
  2. "Unlike a unix shell, Python does not do any automatic path expansions." (https://docs.python.org/3.7/library/os.path.html)

Possible solution

Use os.path.expanduser for the gitignore path.

MatthewRClarke commented 5 years ago

Same issue. Gonna see if I can fix it now

MatthewRClarke commented 5 years ago

47 is open

fzumstein commented 5 years ago

released in 0.4.1