git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Uwe Kleine-K?nig <ukleinek@informatik.uni-freiburg.de>,
	git@vger.kernel.org
Subject: Re: [PATCH] gitk: fix for "gitk <ambiguous-name> --"
Date: Wed, 4 Jul 2007 20:44:21 +1000	[thread overview]
Message-ID: <18059.31237.286280.566140@cargo.ozlabs.ibm.com> (raw)
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"

  parent reply	other threads:[~2007-07-04 10:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-03 20:23 [BUG] gitk fails with argument that is both existing directory and branch name Uwe Kleine-König
2007-07-03 21:55 ` Johannes Schindelin
2007-07-03 22:17   ` Linus Torvalds
2007-07-03 22:44     ` Johannes Schindelin
2007-07-03 22:55     ` [PATCH] gitk: fix for "gitk <ambiguous-name> --" Johannes Schindelin
2007-07-04  7:37       ` Gerrit Pape
2007-07-04  8:38       ` Uwe Kleine-König
2007-07-04 10:44       ` Paul Mackerras [this message]
2007-07-04 16:58         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18059.31237.286280.566140@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=ukleinek@informatik.uni-freiburg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).