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

Re: Problem with cg-diff <file>

From
Junio C Hamano <junkio@cox.net>
Date
May 30, 2005, 00:19 UTC
Message-ID
<7vis11ftvm.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050529233840.GY1036@pasky.ji.cz>
>>>>> "PB" == Petr Baudis <pasky@ucw.cz> writes:

PB> ... git-diff-tree (in contrast to PB> git-diff-cache) won't take the pathspec as its trailing arguments,

PB> Junio, is there any specific reason for that, or is the end of PB> git-diff-tree argument list the right spot for the pathspec stuff?

Baffled.  Are you at Linus tip?

Linus correctly decided that diff-tree does not have to call diffcore_pathspec(), which may be what confused you to make the comment "... in contrast to git-diff-cache) won't take ...". But it does not call it only because it does not need to. It filters the filepairs itself on the input side using the trailing arguments; since diffcore_pathspec filters as the first one in the chain as the input filter, calling it from diff-tree would not cull anything further.

Here is what I am getting from the Linus tip binary, between my HEAD and Linus tip:

$ git-diff-tree -r linus HEAD   >.all    ;# everything
$ git-diff-tree -r linus HEAD t >.t-only ;# limiting to the test suite
$ wc -l .all .t-only                     ;# count results
  12 .all
   3 .t-only
  15 total
$ cat .t-only				 ;# show what's in "t" output
:100644 100644 a51985518251f6c3f677438c3cb51b9716c20296 5ac29d1f98438d3530bbc8b0bdaced58200aca37 M	t/t4005-diff-rename-2.sh
:100644 100644 518892b90c7cbb3fb193d6bfb622046aff0f4431 76ae7201f0d19b7933ca44958b7c468193ec9778 M	t/t4007-rename-3.sh
:000000 100755 0000000000000000000000000000000000000000 01d276692669f2241471b8ad611b17d51e2a98ab N	t/t4009-diff-rename-4.sh
$ head -n 1 .all                         ;# prove that "t" filtered. 
:100644 100644 f85a605f0a336f506cf5cf46476a43e4c56b3e66 1d92a01a02543e55d0feb3541ee594fbc638136c M	Documentation/diff-format.txt
Previous: Petr BaudisNext: Petr Baudis
Message 3 of 6 in “Problem with cg-diff <file>”
  1. Marcel HoltmannMay 29, 2005
  2. Petr BaudisMay 29, 2005
  3. Junio C HamanoMay 30, 2005
  4. Petr BaudisMay 30, 2005
  5. Junio C HamanoMay 30, 2005
  6. Petr BaudisMay 30, 2005

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.