Open TechplexEngineer opened 10 years ago
Thanks for reporting this. I'll look into it later.
same problem here. My git version: git version 1.7.10.4
. @holygeek's patch works for me
+1 for git version 1.7.2.5
on ubuntu linux
The problem here is that somewhere between git 1.7 and the more recent git, they introduced the the --column
switch to git status; and git status
behavior was changed in such a way that untracked files are shown in columns by default.
If untracked files are shown in columns (as they are by default in the more recent git), git number would not be able to process file names that have spaces in them - the space-separated-chunks in the file name would be wrongly assigned with different ids, hence the need for the --column=never
switch.
Omitting the --column=never
option as suggested by @TechplexEngineer in the first comment to work around the lack of this option in the older git version works fine. Once your git is upgraded to the version that shows untracked files in columns then git number would fail to assign numbers to untracked files.
We could make git number be aware of this issue via environment variable, or yet another command line switch but I'm not sure if it is worth it - we can just point people who faces this problem to this issue and they can use the suggested workaround.
This is the price git number is paying for parsing a git porcelain command :)
The error is:
Resolution is commenting out these lines: https://github.com/holygeek/git-number/blob/master/git-id#L86-L88
Here is my git version: