git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Érico RolimNext: Junio C Hamano
Message 2 of 10 in “[BUG] segmentation fault in git-diff”
  1. Érico RolimApr 9, 2020
  2. Junio C HamanoApr 9, 2020
  3. Junio C HamanoApr 9, 2020
  4. Junio C HamanoApr 9, 2020
  5. Junio C HamanoApr 9, 2020
  6. Jeff KingApr 9, 2020
  7. Re* [BUG] segmentation fault in git-diffJunio C Hamano, Apr 10, 2020
  8. Érico RolimApr 10, 2020
  9. Jeff KingApr 10, 2020
  10. Junio C HamanoApr 10, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.