Re: [PATCH] gitk: fix for "gitk <ambiguous-name> --"
- From
Paul Mackerras <paulus@samba.org>
- Date
- Jul 4, 2007, 10:44 UTC
- Message-ID
- <18059.31237.286280.566140@cargo.ozlabs.ibm.com>
- In-Reply-To
- <Pine.LNX.4.64.0707032353330.4071@racer.site>
Johannes Schindelin writes:
> If you have an ambiguous ref, i.e. a file in the working directory bears > the same name, you have to use "--" at the end to disambiguate ref from > file. This works with "git rev-list". Make it work with gitk, too.
This means that if you do "gitk rev -- file" we will end up with two "--" in the git rev-list command that gitk does. I think we actually want the patch below.
Junio: there seems to be an inconsistency between git rev-list and git rev-parse here. If a name is both a filename and a ref, git rev-list will give a fatal error but git rev-parse will take it as a ref.
Paul.
diff --git a/gitk b/gitk index d509145..502a01a 100755 --- a/gitk +++ b/gitk @@ -87,10 +87,7 @@ proc start_rev_list {view} { set startmsecs [clock clicks -milliseconds] set commitidx($view) 0 - set args $viewargs($view) - if {$viewfiles($view) ne {}} { - set args [concat $args "--" $viewfiles($view)] - } + set args [concat $viewargs($view) "--" $viewfiles($view)] set order "--topo-order" if {$datemode} { set order "--date-order"