Re: [BUG] segmentation fault in git-diff
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 9, 2020, 22:45 UTC
- Message-ID
- <xmqqh7xsmg7j.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAFDeuWO+2JEGudtnHZvSsSUOVRR83U9ziLEjSoDyMWxYhvDMKg@mail.gmail.com>
Érico Rolim <erico.erc@gmail.com> writes:
Show 8 quoted lines
> I have found a bug in the git-diff utility, which is reproducible in > the next branch. In any repository, if I run > > git diff :/any/path/ > > (The important part is the trailing forward slash. No slash will > generate either a valid diff or an error message about the path not > being known. ":/" also works without issue)
This is 'next' running for me:
$ git diff :/any/path
fatal: ambiguous argument ':/any/path': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'If looking for a commit that has a string "any/path" in its commit message may be consuming stack resources that are proportional to the depth of the history, however, I can imagine that it might run out of the memory and die, though. Another thing that may be interesting to try is to use "git rev-parse :/any/path" in the same repository you are having trouble with. If the "string :/any/path to a revision" logic is where it is dying, it would die the same way.
Thanks.