git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Érico Rolim" <erico.erc@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [BUG] segmentation fault in git-diff
Date: Thu, 09 Apr 2020 15:45:04 -0700	[thread overview]
Message-ID: <xmqqh7xsmg7j.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAFDeuWO+2JEGudtnHZvSsSUOVRR83U9ziLEjSoDyMWxYhvDMKg@mail.gmail.com> ("Érico Rolim"'s message of "Thu, 9 Apr 2020 19:22:34 -0300")

Érico Rolim <erico.erc@gmail.com> writes:

> 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.




  reply	other threads:[~2020-04-09 22:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 22:22 [BUG] segmentation fault in git-diff Érico Rolim
2020-04-09 22:45 ` Junio C Hamano [this message]
2020-04-09 22:47   ` Junio C Hamano
2020-04-09 22:57     ` Junio C Hamano
2020-04-09 23:37       ` Junio C Hamano
2020-04-09 23:41       ` Jeff King
2020-04-10  0:03         ` Re* " Junio C Hamano
2020-04-10  1:42           ` Érico Rolim
2020-04-10  3:04           ` Jeff King
2020-04-10  5:39             ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqh7xsmg7j.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=erico.erc@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).