xltrail / git-xl

Git extension: Makes git-diff work for VBA in Excel workbooks (xls* file types)

Home Page:https://www.xltrail.com/git-xl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install breaks if ~ in core.excludesfile

ovidner opened this issue · comments

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.

Same issue. Gonna see if I can fix it now

#47 is open

released in 0.4.1