zsh-workers
 help / color / mirror / code / Atom feed
From: "Mikael Magnusson" <mikachu@gmail.com>
To: zsh-workers@sunsite.dk
Subject: Re: git checkout improvement
Date: Thu, 21 Aug 2008 04:22:08 +0200	[thread overview]
Message-ID: <237967ef0808201922g91dd092w5da31759495b74b7@mail.gmail.com> (raw)
In-Reply-To: <237967ef0808201918t4c21baefj456fb9be0605d430@mail.gmail.com>

2008/8/21 Mikael Magnusson <mikachu@gmail.com>:
> 2008/8/21 Clint Adams <clint@zsh.org>:
>> On Thu, Aug 21, 2008 at 02:20:49AM +0200, Mikael Magnusson wrote:
>>> I also noticed completing files from the index doesn't work as well as
>>> completing files from a given tree... eg, If you type
>>> git checkout HEAD gi<tab>
>>> you get git.c, but if you
>>> git checkout -- gi<tab>
>>> you get nothing. However,
>>> git checkout -- <tab>
>>> lists all the files, and lets you cycle through them until you reach git.c
>>> It uses __git_cached_files for that case, but some other places that call
>>> that work just fine with something already typed. You got any idea?
>>
>> I am getting confused here.  Can you use -- when there's a tree-ish on
>> the line?
>
> Yes. All of these are valid commands:
> git checkout git.c
> git checkout HEAD git.c
> git checkout -- git.c
> git checkout HEAD -- git.c

Another problem is you can do
git checkout git.c NEWS
but then we try to use git.c as a tree-ish which obviously doesn't work.
Probably we should check if words[1] (or whatever) is a valid tree-ish,
and if not, complete files from the index instead.

-- 
Mikael Magnusson


  reply	other threads:[~2008-08-21  2:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-21  0:09 Clint Adams
2008-08-21  0:20 ` Mikael Magnusson
2008-08-21  0:52   ` Clint Adams
2008-08-21  2:18     ` Mikael Magnusson
2008-08-21  2:22       ` Mikael Magnusson [this message]
2008-08-21  5:04         ` Clint Adams
2008-08-21  5:19           ` Mikael Magnusson

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=237967ef0808201922g91dd092w5da31759495b74b7@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@sunsite.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).