git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitk from subdirectory
@ 2007-08-31  4:29 Junio C Hamano
  2007-08-31  4:33 ` Junio C Hamano
  2007-08-31  5:08 ` Linus Torvalds
  0 siblings, 2 replies; 9+ messages in thread
From: Junio C Hamano @ 2007-08-31  4:29 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git

Since commit cdaee5db165ba8bae8d3b524950e61666fc36a84 (gitk:
Improve handling of -- and ambiguous arguments), running gitk
from a subdirectory limits the displayed history with the
current directory as the path limiter, because it always passes
the "--" to the underlying git-rev-list.

One obvious side effect of this is if you create a new directory
and cd to it, gitk will not show anything because no commit in
the history has touched the path you are currently in.

I am wondering if this was intended behaviour change.  I think
it makes sense to want an easy way to say "what changed stuff in
the directory I am in?" because presumably you are there because
you are interested in stuff in there.  But if you hard code "--"
it is not easy to disable that and get the global log.

You always can say "gitk -- ." to limit commits to the current
directory, so it might have been just an oversight.  In which
case, the attached patch may be needed to restore the old
behaviour.

Signed-off-by: Junio C Hamano <junkio@pobox.com>
---
 gitk |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/gitk b/gitk
index 300fdce..b95b313 100755
--- a/gitk
+++ b/gitk
@@ -92,8 +92,13 @@ proc start_rev_list {view} {
 	set order "--date-order"
     }
     if {[catch {
+	if {[llength $viewfiles($view)] == 0} {
+	    set rlpaths {}
+	} else {
+	    set rlpaths [list "--" $viewfiles($view)]
+	}
 	set fd [open [concat | git log -z --pretty=raw $order --parents \
-			 --boundary $viewargs($view) "--" $viewfiles($view)] r]
+			 --boundary $viewargs($view) $rlpaths] r]
     } err]} {
 	error_popup "Error executing git rev-list: $err"
 	exit 1

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

end of thread, other threads:[~2007-08-31  7:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-31  4:29 gitk from subdirectory Junio C Hamano
2007-08-31  4:33 ` Junio C Hamano
2007-08-31  5:08 ` Linus Torvalds
2007-08-31  5:29   ` Junio C Hamano
2007-08-31  5:32     ` Junio C Hamano
2007-08-31  5:45   ` Junio C Hamano
2007-08-31  5:51     ` Junio C Hamano
2007-08-31  7:38     ` Linus Torvalds
2007-08-31  7:40       ` 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).