git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bogus error from git log --full-diff
@ 2020-06-19 15:15 Andreas Schwab
  2020-06-19 16:14 ` Konstantin Tokarev
  2020-06-19 17:10 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas Schwab @ 2020-06-19 15:15 UTC (permalink / raw)
  To: git

If you have log.follow=true, then git log --full-diff doesn't work any
more, giving a bogus error:

$ ./git -c log.follow=true log --full-diff .
fatal: --follow requires exactly one pathspec

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bogus error from git log --full-diff
  2020-06-19 15:15 Bogus error from git log --full-diff Andreas Schwab
@ 2020-06-19 16:14 ` Konstantin Tokarev
  2020-06-19 17:13   ` Junio C Hamano
  2020-06-19 17:10 ` Junio C Hamano
  1 sibling, 1 reply; 4+ messages in thread
From: Konstantin Tokarev @ 2020-06-19 16:14 UTC (permalink / raw)
  To: Andreas Schwab, git



19.06.2020, 18:59, "Andreas Schwab" <schwab@linux-m68k.org>:
> If you have log.follow=true, then git log --full-diff doesn't work any
> more, giving a bogus error:
>
> $ ./git -c log.follow=true log --full-diff .
> fatal: --follow requires exactly one pathspec

I've reported this issue in February on this very list and didn't get any reaction from developers.
Seems like it's not considered to be a bug.

-- 
Regards,
Konstantin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bogus error from git log --full-diff
  2020-06-19 15:15 Bogus error from git log --full-diff Andreas Schwab
  2020-06-19 16:14 ` Konstantin Tokarev
@ 2020-06-19 17:10 ` Junio C Hamano
  1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2020-06-19 17:10 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: git

Andreas Schwab <schwab@linux-m68k.org> writes:

> If you have log.follow=true, then git log --full-diff doesn't work any
> more, giving a bogus error:

Does "any more" mean it used to work with older version of Git, or
it used to work before log.follow is thrown into the configuration
file?

> $ ./git -c log.follow=true log --full-diff .
> fatal: --follow requires exactly one pathspec

I see one and half possible bogosities in here.

 * "--follow" is about following a single path, so even without
   "--full-diff", i.e. "git log --follow .", should not proceed but
   notice it as an error.  The pathspec should name a single path,
   like "helloworld.py" (and no, git does not track directories, so
   "."  is not a single path.  The pathspec "." matches everything
   under that directory).

 * "--full-diff" wants to make a full comparison between two trees
   (in the case of "git log", the child and its parent(s)), but
   "--follow" wants to make a comparison between just two blobs
   (i.e. the path that it is following in the child, and the
   "corresponding" blob in the parent commit(s)), so they are
   inherently incompatible.

Since neither is flagged as an error, the "--follow" logic is upset
when "--full-diff" widens the input of the "diff" run internally
(the error message comes from the fact that full-diff cleared the
pathspec used to generate this diff that the "--follow" logic uses
to find the corresponding path it is following---it sees zero when
it wants to have one).

I said these are one-and-half, because a reasonable expectation by
the end user could be that the configured log.follow is automatically
turned off when any incompatible option is given from the command
line, i.e.

    git -c log.follow=yes log --full-diff .

should be equivalent to

    git log --full-diff .

and not

    git log --full-diff --follow .

And with that, we should not see the bogus * 1.5 error message.

So, I see 3 potential things that can be improved.  Tightened error
checking for "--follow" itself, tightened error checking for mutual
exclusivity, and turning configured log.follow off automatically.

Thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bogus error from git log --full-diff
  2020-06-19 16:14 ` Konstantin Tokarev
@ 2020-06-19 17:13   ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2020-06-19 17:13 UTC (permalink / raw)
  To: Konstantin Tokarev; +Cc: Andreas Schwab, git

Konstantin Tokarev <annulen@yandex.ru> writes:

> I've reported this issue in February on this very list and didn't
> get any reaction from developers.  Seems like it's not considered
> to be a bug.

Please do not read too much into lack of response.  It may be caused
by many things, including (certainly non-exhaustive):

 (1) the message may have been un-understandable and/or did not look
     interesting enough to ask for clarifications and more info to
     produce a useful response,

 (2) the message may have been delivered in a hostile tone that
     people chose to ignore even though it raised a valid issue, or

 (3) the message was simply missed because everybody was busy doing
     other things.

By default, everybody should assume the last one.  Re-raising the
issue after some cooling-off period would be a good strategy.

Thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-19 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 15:15 Bogus error from git log --full-diff Andreas Schwab
2020-06-19 16:14 ` Konstantin Tokarev
2020-06-19 17:13   ` Junio C Hamano
2020-06-19 17:10 ` Junio C Hamano

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 NNTP newsgroup(s).