git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] gitk: handle --full-diff correctly

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Oct 19, 2012, 10:56 UTC
Message-ID
<1350644213-4882-3-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1350644213-4882-1-git-send-email-felipe.contreras@gmail.com>
Otherwise the files are missing from the diff, and the list of files.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 gitk-git/gitk | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index b79dfdf..8109eed 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -155,7 +155,7 @@ proc unmerged_files {files} {
 }
 
 proc parseviewargs {n arglist} {
-    global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs env
+    global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs vfileargs env
     global worddiff git_version
 
     set vdatemode($n) 0
@@ -165,6 +165,7 @@ proc parseviewargs {n arglist} {
     set nextisval 0
     set revargs {}
     set origargs $arglist
+    set fileargs {}
     set allknown 1
     set filtered 0
     set i -1
@@ -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.
@@ -233,6 +234,9 @@ proc parseviewargs {n arglist} {
 		set filtered 1
 		lappend glflags $arg
 	    }
+	    "--full-diff" {
+		lappend fileargs $arg
+	    }
 	    "-n" {
 		# This appears to be the only one that has a value as a
 		# separate word following it
@@ -276,6 +280,7 @@ proc parseviewargs {n arglist} {
     set vrevs($n) $revargs
     set vfiltered($n) $filtered
     set vorigargs($n) $origargs
+    set vfileargs($n) $fileargs
     return $allknown
 }
 
@@ -7519,10 +7524,11 @@ proc diffcmd {ids flags} {
 }
 
 proc gettreediffs {ids} {
-    global treediff treepending limitdiffs vfilelimit curview
+    global treediff treepending limitdiffs vfilelimit vfileargs curview
 
     set cmd [diffcmd $ids {--no-commit-id}]
     if {$limitdiffs && $vfilelimit($curview) ne {}} {
+	    set cmd [concat $cmd $vfileargs($curview)]
 	    set cmd [concat $cmd -- $vfilelimit($curview)]
     }
     if {[catch {set gdtf [open $cmd r]}]} return
@@ -7613,7 +7619,7 @@ proc getblobdiffs {ids} {
     global diffcontext
     global ignorespace
     global worddiff
-    global limitdiffs vfilelimit curview
+    global limitdiffs vfilelimit vfileargs curview
     global diffencoding targetline diffnparents
     global git_version currdiffsubmod
 
@@ -7633,6 +7639,7 @@ proc getblobdiffs {ids} {
 	append cmd " --word-diff=porcelain"
     }
     if {$limitdiffs && $vfilelimit($curview) ne {}} {
+	set cmd [concat $cmd $vfileargs($curview)]
 	set cmd [concat $cmd -- $vfilelimit($curview)]
     }
     if {[catch {set bdf [open $cmd r]} err]} {
-- 
1.8.0.rc2.7.g0961fdf.dirty
Previous: Felipe ContrerasNext: Johannes Sixt
Message 3 of 5 in “gitk: fix --full-diff handling”
  1. 0/2 gitk: fix --full-diff handlingFelipe Contreras, Oct 19, 2012
  2. 1/2 gitk: simplify file filteringFelipe Contreras, Oct 19, 2012
  3. 2/2 gitk: handle --full-diff correctlyFelipe Contreras, Oct 19, 2012
  4. Johannes SixtOct 19, 2012
  5. Felipe ContrerasOct 19, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.