[PATCH 2/2] gitk: handle --full-diff correctly
Otherwise the files are missing from the diff, and the list of files.
We do this by creating a limitdiffs variable specific for the view which can be turned of by using --full-diff.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
gitk-git/gitk | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
Show changes to gitk-git/gitk +12 −8
diff --git a/gitk-git/gitk b/gitk-git/gitk
index b79dfdf..4ffabdf 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -155,11 +155,12 @@ proc unmerged_files {files} {
}
proc parseviewargs {n arglist} {
- global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs env
- global worddiff git_version
+ global vdatemode vmergeonly vlimitdiffs vflags vdflags vrevs vfiltered vorigargs env
+ global limitdiffs worddiff git_version
set vdatemode($n) 0
set vmergeonly($n) 0
+ set vlimitdiffs($n) $limitdiffs
set glflags {}
set diffargs {}
set nextisval 0
@@ -187,7 +188,7 @@ proc parseviewargs {n arglist} {
"--no-renames" - "--full-index" - "--binary" - "--abbrev=*" -
"--find-copies-harder" - "-l*" - "--ext-diff" - "--no-ext-diff" -
"--src-prefix=*" - "--dst-prefix=*" - "--no-prefix" -
- "-O*" - "--text" - "--full-diff" - "--ignore-space-at-eol" -
+ "-O*" - "--text" - "--ignore-space-at-eol" -
"--ignore-space-change" - "-U*" - "--unified=*" {
# These request or affect diff output, which we don't want.
# Some could be used to set our defaults for diff display.
@@ -251,6 +252,9 @@ proc parseviewargs {n arglist} {
"--no-replace-objects" {
set env(GIT_NO_REPLACE_OBJECTS) "1"
}
+ "--full-diff" {
+ set vlimitdiffs($n) 0
+ }
"-*" {
# Other flag arguments including -<n>
if {[string is digit -strict [string range $arg 1 end]]} {
@@ -7519,10 +7523,10 @@ proc diffcmd {ids flags} {
}
proc gettreediffs {ids} {
- global treediff treepending limitdiffs vfilelimit curview
+ global treediff treepending vlimitdiffs vfilelimit curview
set cmd [diffcmd $ids {--no-commit-id}]
- if {$limitdiffs && $vfilelimit($curview) ne {}} {
+ if {$vlimitdiffs($curview) && $vfilelimit($curview) ne {}} {
set cmd [concat $cmd -- $vfilelimit($curview)]
}
if {[catch {set gdtf [open $cmd r]}]} return
@@ -7535,7 +7539,7 @@ proc gettreediffs {ids} {
proc gettreediffline {gdtf ids} {
global treediff treediffs treepending diffids diffmergeid
- global cmitmode vfilelimit curview limitdiffs perfile_attrs
+ global cmitmode vfilelimit curview perfile_attrs
set nr 0
set sublist {}
@@ -7613,7 +7617,7 @@ proc getblobdiffs {ids} {
global diffcontext
global ignorespace
global worddiff
- global limitdiffs vfilelimit curview
+ global vlimitdiffs vfilelimit curview
global diffencoding targetline diffnparents
global git_version currdiffsubmod
@@ -7632,7 +7636,7 @@ proc getblobdiffs {ids} {
if {$worddiff ne [mc "Line diff"]} {
append cmd " --word-diff=porcelain"
}
- if {$limitdiffs && $vfilelimit($curview) ne {}} {
+ if {$vlimitdiffs($curview) && $vfilelimit($curview) ne {}} {
set cmd [concat $cmd -- $vfilelimit($curview)]
}
if {[catch {set bdf [open $cmd r]} err]} {
--
1.8.0