diff options
author | Linus Torvalds <torvalds@osdl.org> | 2005-10-25 13:01:42 -0700 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-27 16:01:15 +1000 |
commit | 8b7e5d76e836396a097bb6f61cf930ea872a7bd3 (patch) | |
tree | ef86ca4a38b65efc1ab638fd687872738e50fe0a /gitk | |
parent | 9e026d3967776a1c1206890492ffc9d172bf1e9b (diff) | |
download | git-8b7e5d76e836396a097bb6f61cf930ea872a7bd3.tar.gz git-8b7e5d76e836396a097bb6f61cf930ea872a7bd3.tar.xz |
[PATCH] Make "gitk" work better with dense revlists
To generate the diff for a commit, gitk used to do
git-diff-tree -p -C $p $id
(and same thing to generate filenames, except using just "-r" there) which
does actually generate the diff from the parent to the $id, exactly like
it meant to do.
However, that really sucks with --dense, where the "parent" information
has all been rewritten to point to the previous commit. The diff actually
works exactly right, but now it's the diff of the _whole_ sequence of
commits all the way to the previous commit that last changed the file(s)
that we are looking at.
And that's really not what we want 99.9% of the time, even if it may be
perfectly sensible. Not only will the diff not actually match the commit
message, but it will usually be _huge_, and all of it will be totally
uninteresting to us, since we were only interested in a particular set of
files.
It also doesn't match what we do when we write the patch to a file.
So this makes gitk just show the diff of _that_ commit.
We might even want to have some way to limit the diff to only the
filenames we're interested in, but it's often nice to see what else
changed at the same time, so that's secondary.
The merge diff handling is left alone, although I think that should also
be changed to only look at what that _particular_ merge did, not what it
did when compared to the faked-out parents.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-x | gitk | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2806,7 +2806,7 @@ proc gettreediffs {ids} { set treediff {} set id [lindex $ids 0] set p [lindex $ids 1] - if [catch {set gdtf [open "|git-diff-tree -r $p $id" r]}] return + if [catch {set gdtf [open "|git-diff-tree -r $id" r]}] return fconfigure $gdtf -blocking 0 fileevent $gdtf readable [list gettreediffline $gdtf $ids] } @@ -2842,7 +2842,7 @@ proc getblobdiffs {ids} { set id [lindex $ids 0] set p [lindex $ids 1] set env(GIT_DIFF_OPTS) $diffopts - set cmd [list | git-diff-tree -r -p -C $p $id] + set cmd [list | git-diff-tree -r -p -C $id] if {[catch {set bdf [open $cmd r]} err]} { puts "error getting diffs: $err" return |