git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitk: simplify file filtering
@ 2013-04-27 22:01 Felipe Contreras
  2013-05-11  9:42 ` Paul Mackerras
  0 siblings, 1 reply; 8+ messages in thread
From: Felipe Contreras @ 2013-04-27 22:01 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras, Jens Lehmann, Felipe Contreras

git diff is perfectly able to do this with '-- files', no need for
manual filtering.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 gitk-git/gitk | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index b3706fc..0863877 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -7571,9 +7571,13 @@ proc diffcmd {ids flags} {
 }
 
 proc gettreediffs {ids} {
-    global treediff treepending
+    global treediff treepending limitdiffs vfilelimit curview
 
-    if {[catch {set gdtf [open [diffcmd $ids {--no-commit-id}] r]}]} return
+    set cmd [diffcmd $ids {--no-commit-id}]
+    if {$limitdiffs && $vfilelimit($curview) ne {}} {
+	    set cmd [concat $cmd -- $vfilelimit($curview)]
+    }
+    if {[catch {set gdtf [open $cmd r]}]} return
 
     set treepending $ids
     set treediff {}
@@ -7617,17 +7621,7 @@ proc gettreediffline {gdtf ids} {
 	return [expr {$nr >= $max? 2: 1}]
     }
     close $gdtf
-    if {$limitdiffs && $vfilelimit($curview) ne {}} {
-	set flist {}
-	foreach f $treediff {
-	    if {[path_filter $vfilelimit($curview) $f]} {
-		lappend flist $f
-	    }
-	}
-	set treediffs($ids) $flist
-    } else {
-	set treediffs($ids) $treediff
-    }
+    set treediffs($ids) $treediff
     unset treepending
     if {$cmitmode eq "tree" && [llength $diffids] == 1} {
 	gettree $diffids
-- 
1.8.2.1.1031.g2ee5873

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-05-13 14:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-27 22:01 [PATCH] gitk: simplify file filtering Felipe Contreras
2013-05-11  9:42 ` Paul Mackerras
2013-05-12 22:54   ` Junio C Hamano
2013-05-13  0:36     ` Paul Mackerras
2013-05-13  8:58       ` Stefan Haller
2013-05-13 11:37         ` Paul Mackerras
2013-05-13 11:34     ` Paul Mackerras
2013-05-13 14:53       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).