Thomas Rast <tr...@inf.ethz.ch> writes:
> Junio C Hamano <gits...@pobox.com> writes:
>> * tr/log-full-diff-keep-true-parents (2013-08-01) 1 commit
>> - log: use true parents for diff even when rewriting
>> Output from "git log --full-diff -- <pathspec>" looked strange,
>> because comparison was done with the previous ancestor that touched
>> the specified <pathspec>, causing the patches for paths outside the
>> pathspec to show more than the single commit has changed.
>> I am not sure if that is necessarily a problem, though. Output
>> from "git log --full-diff -2 -- <pathspec>" without this change
>> will be applicable to some codebase, but after this change that
>> will no longer be true (you will get only tiny parts of the change
>> that were made by the two commits in question, while missing all
>> the other changes).
> Hmm. Uwe's original complaint was that --stat -- as in "what other
> things are touched when we modify foo" -- is nonsensical.
> In addition, applying what you describe above would be a very strange
> form of rebase: one that squashes everything into the commits that
> affect the given files. When would it ever make sense to do such
> squashing? After all, you'd lose all the commit splits&messages in
I am not so worried about actually applying that kind of patch, but
more about reviewing what happened in each of the single logical
step shown. If you made two changes in two far-apart commits to
files you are interested in and want to look at the changes made to
other files to make each of them a complete solution, depending on
how the change was split across files, you would get useful to
useless result with your patch. In one extreme, if your commits are
too fine-grained and you committed one path at a time, then
"full-diff" will not show anything useful, as the commits that hit
the pathspec do not have changes to any other paths. In another
extreme, you may have preparatory changes to other paths in commits
that immediately precede the commit that hits the pathspec and then
finally conclude the topic by introducing a caller of the prepared
codepath in other files to the file you are interested in, and your
patch will show only the endgame change without showing the
preparatory steps, which may or may not be useful, depending on what
you are looking for.
So while I do understand why sometimes you wish to see full diff
"git log --full-diff -- <pathspec>" to match output from "git show"
without pathspec, I am not sure doing it unconditionally and by
default like your patch does is the best way to go.
In the meantime:
git rev-list --header --parents HEAD -- <pathspec> |
git -p diff-tree -p --stdin
would be one way to do so.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html