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

Re: [PATCH v7 0/5] git log -L, all new and shiny

From
Thomas Rast <trast@inf.ethz.ch>
Date
Jun 19, 2012, 10:11 UTC
Message-ID
<87wr33wqzl.fsf@thomas.inf.ethz.ch>
In-Reply-To
<7v1ulf94nq.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Thomas Rast <trast@student.ethz.ch> writes:
>>
>>> This would be the first backwards coupling between the revision-walk and
>>> the diff generation parts, at least that I know of.
>>
>> I am not convinced if you need to have any unusual back-coupling to
>> begin with, by the way.
>>
>> If you say "git log -p [--options] -- pathspec", the revision
>> machinery does filter commits that do not touch any paths that patch
>> pathspec with the TREESAME logic, but that does not necessarily mean
>> you will see _all_ the commits that are not TREESAME.
[...]
Show 15 quoted lines
> The revision machinery looks at C and finds its parent B.  It runs
> object level tree comparison and finds that their trees are
> different at path F.  It makes a mental note that it may need to
> show the log message of C, and asks the diff machinery to run
> diff-tree between B and C.  The diff machinery finds that it needs
> to show something even in the presense of -w option by actual
> comparison, and just before showing the very first line of patch
> output, it shows the log message of C (due to the earlier "mental
> note").
>
> Then the revision machinery looks at B.  It does the same between B
> and A, but this time around, the diff machinery finds that, even
> though A and B were _not_ TREESAME at the revision traversal level,
> there is nothing to be shown after filtering with the -w option.
> Hence no patch is shown and log message for B is not shown, either.
Thanks for the great explanations.

Having spent some time letting this sink in (and being busy doing other things), I think it's actually a good idea. It forces us to go back and change it around so that the diff machinery gets a say _before_ we simplify history. I think this bit will be important for log -L history to make sense, and it's a bug waiting to happen for the -w case.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Junio C HamanoNext: Junio C Hamano
Message 17 of 18 in “git log -L, all new and shiny”
  1. 0/5 git log -L, all new and shinyThomas Rast, Jun 7, 2012
  2. 1/5 Refactor parse_locThomas Rast, Jun 7, 2012
  3. 2/5 blame: introduce $ as "end of file" in -L syntaxThomas Rast, Jun 7, 2012
  4. Junio C HamanoJun 7, 2012
  5. Thomas RastJun 7, 2012
  6. 3/5 Export three functions from diff.cThomas Rast, Jun 7, 2012
  7. Junio C HamanoJun 7, 2012
  8. 4/5 Export rewrite_parents() for 'log -L'Thomas Rast, Jun 7, 2012
  9. 5/5 Implement line-history search (git log -L)Thomas Rast, Jun 7, 2012
  10. Junio C HamanoJun 7, 2012
  11. Thomas RastJun 7, 2012
  12. Zbigniew Jędrzejewski-SzmekJun 10, 2012
  13. Junio C HamanoJun 15, 2012
  14. Thomas RastJun 15, 2012
  15. Junio C HamanoJun 15, 2012
  16. Junio C HamanoJun 16, 2012
  17. Thomas RastJun 19, 2012
  18. Junio C HamanoJun 19, 2012

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.