2

I run a command git blame --show-email foo.txt and it works. But I run another command git blame --show-email foo+bar.txt and get:

fatal: no such path 'ParentDir/Foo+Bar.txt' in HEAD

I ran a panoply of googles for "git blame + character error", "bash processing special characters", "addition sign in filename terminal error", and about 20 other variants and gained 0% insight.

Is this a bash, git, or git-blame problem? If so, how can I sanitize/make-work this command?

Alex Bollbach
  • 4,370
  • 9
  • 32
  • 80
  • I cannot reproduce this issue, I created a file `ParentDir/Foo+Bar.txt`, committed it, and can view the blame just fine. I found this question about changing the case of the parent directory: https://stackoverflow.com/q/42077734/7362396 - If I do this I get exactly the *no such path in HEAD* error. – Tobias K. Aug 26 '18 at 17:07
  • but i ran a script that iterates over all files in a directory. and this error occurred precisely on each file name with a `+` in it. it could be that the error from your link (insofar as i can even understand it), is indeed the true source, and its a coincidence that I happen to have the convention of adding a `+` when I commit this underlying error. WOW – Alex Bollbach Aug 26 '18 at 17:12
  • It sounds like I should close this as a duplicate of the linked question (though the "duplicate" is kind of a surprise). Yes? No? – torek Aug 26 '18 at 20:25
  • what i understand is the "+"'s in my file names were a total red herring. its likely that at some point I decided to reorganize folder structure and file naming and used a `this+that.ext` in the process. now, all those files exhibit the symptom discussed in the linked question. still going back and doing some forensics to validate those assumptions. – Alex Bollbach Aug 26 '18 at 21:09
  • but i haven't really been able to make sense of that post. e.g. some files are missing when i run `git ls-files`, which might have something to do w/ the filepath git associates with them not being part of the current working directory (which doesn't really make sense to me). but then there are still some files that are listed by the command, that also fail with this error. in the end, i have no idea whats going on here. the linked answer is beyond my understanding. – Alex Bollbach Aug 26 '18 at 21:15

0 Answers0