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

3 messages from 2010-03-24 to 2010-03-24. Participants: Jay Soffian, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/23162

## Jay Soffian, 2010-03-24 15:52

Subject: git log: why are --full-diff and --pickaxe-all separate options?
Message-ID: <76718491003240852m2a2c12afjca2c71f6c78b2047@mail.gmail.com>
URL: https://gitlist.dev/e/76718491003240852m2a2c12afjca2c71f6c78b2047%40mail.gmail.com

```
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, 2010-03-24 16:20

Subject: Re: git log: why are --full-diff and --pickaxe-all separate options?
Message-ID: <20100324162005.GA6626@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20100324162005.GA6626%40sigill.intra.peff.net
In-Reply-To: <76718491003240852m2a2c12afjca2c71f6c78b2047@mail.gmail.com>

```
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, 2010-03-24 17:19

Subject: Re: git log: why are --full-diff and --pickaxe-all separate options?
Message-ID: <7vy6hhr624.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vy6hhr624.fsf%40alter.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.

```
