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

Re: gitk highlight feature

From
Linus Torvalds <torvalds@osdl.org>
Date
May 3, 2006, 23:25 UTC
Message-ID
<Pine.LNX.4.64.0605031612230.4086@g5.osdl.org>
In-Reply-To
<17497.14311.121872.249120@cargo.ozlabs.ibm.com>
On Thu, 4 May 2006, Paul Mackerras wrote:
Show 12 quoted lines
> 
> On my G5:
> 
> $ git-rev-list HEAD >all-revs
> $ time git-rev-list HEAD -- arch/powerpc >ppc-revs
> real    0m2.463s
> user    0m2.265s
> sys     0m0.191s
> $ time git-diff-tree -s --stdin -- arch/powerpc <all-revs >ppc-revs2
> real    0m5.269s
> user    0m4.794s
> sys     0m0.462s

Right. One of them prunes the history (git-rev-list). The other one does not.

That said, you need an "-r", I guess, to "git-diff-tree".
> Why does git-diff-tree -s --stdin produce so many more revisions than
> git-rev-list?

I guess it's officially a FAQ by now: see the "bug in git log" thread the other day, and

        http://www.gelato.unsw.edu.au/archives/git/0604/19180.html
so in general you can get _more_ of the "real commits" with "git-rev-list 
| git-diff-tree --stdin", because it won't prune out history on 
uninteresting branches. At the same time, that effect is counter-acted by 
git-diff-tree normally ignoring merges by default, which is a bigger 
issue.
Your big problem is just the lack of "-r", though:
> The git-diff-tree output includes commits such as
> 6ba815de, which only affects arch/i386/kernel/timers/timer_tsc.c.
> Confused.

Without the -r, git-diff-tree won't actually recurse, so it hits the "arch/" part (which does differ, and matches te revspec), and decides it's done.

With the "-r" thing, you still have a noticeable difference, but now it's due to the difference between "log" and "diff":

   git-rev-list HEAD -- arch/powerpc | wc -l
    -> 892
   git-rev-list HEAD | git-diff-tree -r -s --stdin -- arch/powerpc/ | wc -l
    -> 838

ie "diff" doesn't show merges nomally (with -m, you _will_ get merges, but you'll sometimes get them twice - once against each parent ;)

		Linus
Previous: Paul MackerrasNext: Paul Mackerras
Message 9 of 12 in “gitk highlight feature”
  1. Paul MackerrasMay 2, 2006
  2. Junio C HamanoMay 2, 2006
  3. Paul MackerrasMay 3, 2006
  4. Linus TorvaldsMay 3, 2006
  5. Linus TorvaldsMay 3, 2006
  6. Paul MackerrasMay 3, 2006
  7. Linus TorvaldsMay 3, 2006
  8. Paul MackerrasMay 3, 2006
  9. Linus TorvaldsMay 3, 2006
  10. Paul MackerrasMay 20, 2006
  11. Linus TorvaldsMay 20, 2006
  12. Paul MackerrasMay 21, 2006

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.