Skip to content

Commit

Permalink
gitk: Fix some bugs with path limiting in the diff display
Browse files Browse the repository at this point in the history
First, we weren't putting "--" between the ids and the paths in the
git diff-tree/diff-index/diff-files command, so if there was a tag
and a file with the same name, we could get an ambiguity in the
command.  This puts the "--" in to make it clear that the paths are
paths.

Secondly, this implements the path limiting for merge diffs as well
as the normal 2-way diffs.

Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Paul Mackerras committed Oct 23, 2007
1 parent 9450391 commit bd8f677
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gitk
Original file line number Diff line number Diff line change
Expand Up @@ -4913,12 +4913,16 @@ proc mergediff {id l} {
global diffmergeid diffopts mdifffd
global diffids
global parentlist
global limitdiffs viewfiles curview

set diffmergeid $id
set diffids $id
# this doesn't seem to actually affect anything...
set env(GIT_DIFF_OPTS) $diffopts
set cmd [concat | git diff-tree --no-commit-id --cc $id]
if {$limitdiffs && $viewfiles($curview) ne {}} {
set cmd [concat $cmd -- $viewfiles($curview)]
}
if {[catch {set mdf [open $cmd r]} err]} {
error_popup "Error getting merge diffs: $err"
return
Expand Down Expand Up @@ -5152,7 +5156,7 @@ proc getblobdiffs {ids} {
set env(GIT_DIFF_OPTS) $diffopts
set cmd [diffcmd $ids "-p -C --no-commit-id -U$diffcontext"]
if {$limitdiffs && $viewfiles($curview) ne {}} {
set cmd [concat $cmd $viewfiles($curview)]
set cmd [concat $cmd -- $viewfiles($curview)]
}
if {[catch {set bdf [open $cmd r]} err]} {
puts "error getting diffs: $err"
Expand Down

0 comments on commit bd8f677

Please sign in to comment.