[GITK PATCH 2/3] gitk: support path filters even in subdirectories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Even when running inside a subdirectory, "gitk HEAD -- ." should work.

Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
---
 gitk-git/gitk |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 553922f..bad9ebc 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -7340,9 +7340,12 @@ proc startdiff {ids} {
 }
 
 proc path_filter {filter name} {
+    global pathprefix
     foreach p $filter {
 	if {$p == "."} {
-		return 1
+		set p $pathprefix
+	} else {
+		set p $pathprefix$p
 	}
 	set l [string length $p]
 	if {[string index $p end] eq "/"} {
@@ -11585,6 +11588,7 @@ readrefs
 
 if {$cmdline_files ne {} || $revtreeargs ne {} || $revtreeargscmd ne {}} {
     # create a view for the files/dirs specified on the command line
+    set pathprefix [exec git rev-parse --show-prefix]
     set curview 1
     set selectedview 1
     set nextviewnum 2
-- 
1.6.4.297.gcb4cc


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]