git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Matthias Kestenholz <lists@irregular.ch>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: Bug in git log
Date: Tue, 2 May 2006 08:26:39 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0605020817060.4086@g5.osdl.org> (raw)
In-Reply-To: <20060502134158.GC4592@spinlock.ch>



On Tue, 2 May 2006, Matthias Kestenholz wrote:
> 
> The "double dash" problem is not a big deal since it only happens
> with the deprecated shellscript-version of whatchanged.

Simple enough to fix. Appended.

The problem was that "git-rev-parse --no-flags --no-revs" will show _just_ 
the filenames from the argument list. That means that it will also remove 
the "--" from the original. That's all well and proper, but 
git-whatchanged had a bug, and it wouldn't separate the filename arguments 
from the flags by adding its own "--".

That bug didn't matter back when we didn't check the parsing all that 
carefully. It does now.

> Does anyone get some output with the following command? That was the
> bug I tried to report (sorry for my bad/convoluted english)
> 
> $ git log -- unresolve.c

Now, this returns empty, and it actually does that for a reason.

Along the main path, "unresolve.c" has never existed. The modern 
"git-whatchanged" (and "git log") is a bit different from the old 
big-whatchanged.

The old git-whatchanged would go through _every_ commit, because it 
literally did

	git-rev-list | git-diff-tree --stdin -- <paths>

and thus the revision list was generated without _any_ regard for the 
paths - and every single commit shows up, whether it is relevant or not.

The new revision is based on the revision parsing thing, and the semantics 
are a bit different: it semantically does the equivalent of

	git-rev-list <paths> | git-diff-tree --stdin -- <paths>

which limits the revision list too on the paths.

And yes, "git log" does the same.

See the discussion a few weeks ago about "path limiting broken", and my 
patch that suggested a "--no-prune-merges" flag:

	http://www.gelato.unsw.edu.au/archives/git/0604/19180.html

which gives more of an explanation.

		Linus

--
diff --git a/git-whatchanged.sh b/git-whatchanged.sh
index 1fb9feb..bb73cff 100755
--- a/git-whatchanged.sh
+++ b/git-whatchanged.sh
@@ -24,5 +24,5 @@ rev_list_args=$(git-rev-parse --sq --def
 diff_tree_args=$(git-rev-parse --sq --no-revs --no-flags "$@") &&
 
 eval "git-rev-list $count $rev_list_args" |
-eval "git-diff-tree --stdin --pretty -r $diff_tree_flags $diff_tree_args" |
+eval "git-diff-tree --stdin --pretty -r $diff_tree_flags -- $diff_tree_args" |
 LESS="$LESS -S" ${PAGER:-less}

      reply	other threads:[~2006-05-02 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-02  7:51 Bug in git log Matthias Kestenholz
2006-05-02  8:24 ` Junio C Hamano
2006-05-02 13:41   ` Matthias Kestenholz
2006-05-02 15:26     ` Linus Torvalds [this message]

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

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

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0605020817060.4086@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=lists@irregular.ch \
    /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.
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).