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

Re: git log: why are --full-diff and --pickaxe-all separate options?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 24, 2010, 17:19 UTC
Message-ID
<7vy6hhr624.fsf@alter.siamese.dyndns.org>
In-Reply-To
<76718491003240852m2a2c12afjca2c71f6c78b2047@mail.gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
> But now I wonder why these are separate options. Is there any reason
> they shouldn't be unified?

They do entirely different things, and It does not make any sense to "unify" them.

But it would be an improvement to make them work better together.
 - Erroring out when --pickaxe-all is given without -S would make sense;
 - Making --full-diff to imply --pickaxe-all when -S is used would also
   make sense.
[Footnote]

*1* I wrote the following before reading Jeff's response where I explained it already; it should say the same thing so if you read the message Jeff pointed at, you don't have to read this, but I didn't want to waste my typing, so ...

  The log dataflow is:
  - revision walker finds commits one-by-one, but limiting the commits
    to the ones that touch the paths in the pathspec.
  - each found commit and its ancestor(s) are given to the diff
    machinery, in order to skip the commit if there is no difference,
    and also as a side effect to show the diff.
  - diff front-end collects paths in the commit pair, limited by the
    pathspec given.  however, this can be countermanded with full-diff.
  - diffcore does its thing---compares the collected paths, ignoring
    changes between pairs that do not satisfy pickaxe filter (if given).
    - when pickaxe is in effect, usually paths that do not satisfy the
      pickaxe filter is _discarded_ even if they are different between
      the parent and the child.
    - pickaxe-all however prevents the above.  If even one path
      satisifies the pickaxe filter, all paths survive.
  - if there are still changes after the above computation, the change
    is shown in diff form (when -p is given).
For example, "log -Shello -- world/" would:
  a) limit to commits that touch something in world/ directory;
  b) compare commit and its parents but limit this comparison in world/
     directory.
  c) if some compared file have different number of "hello" in parent and
     child, diff for only those files is shown.
  Giving --full-diff affects step b.  files outside world/ will also be
  inspected in step c and the ones that changes the number of "hello"
  are shown even if outside world/
  Giving --pickaxe affects step c.
Previous: Jeff King
Message 3 of 3 in “git log: why are --full-diff and --pickaxe-all separate options?”
  1. Jay SoffianMar 24, 2010
  2. Jeff KingMar 24, 2010
  3. Junio C HamanoMar 24, 2010

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.