[GITK PATCH 2/3] gitk: support path filters even in subdirectories
Even when running inside a subdirectory, "gitk HEAD -- ." should work.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
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