threads / discuss / 23162

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

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

## tl;dr

3 messages between Mar 24, 2010 and Mar 24, 2010.

replies: 2people: 3as markdown or json

Jay Soffian· Mar 24, 2010, 15:52 UTC · lore
I just did this:
$ git log -p -- /some/path

And didn't get the full commit. I know about the --pickaxe-all option, so I optimistically tried:

$ git log -p --pickaxe-all -- /some/path

Which of course, does not do what I want. Eventually I found in the man page that I can do this:

$ git log -p --full-diff -- /some/path

But now I wonder why these are separate options. Is there any reason they shouldn't be unified?

Regardless, perhaps --pickaxe-all without -S and --full-diff without -p should be errors?

j.
Jeff King· Mar 24, 2010, 16:20 UTC · re: Jay Soffian · lore

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

On Wed, Mar 24, 2010 at 11:52:13AM -0400, Jay Soffian wrote:
> But now I wonder why these are separate options. Is there any reason
> they shouldn't be unified?

I agree it is confusing, and the answer is "maybe". A long and gory explanation can be found here:

  http://article.gmane.org/gmane.comp.version-control.git/34909

Read the later messages in the thread from Junio, too, as he goes back and forth a bit. I don't remember if anything happened after that, or why not.

-Peff
Junio C Hamano· Mar 24, 2010, 17:19 UTC · re: Jay Soffian · lore

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

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.

← back to recent threads