Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: git checkout improvement



2008/8/21 Mikael Magnusson <mikachu@xxxxxxxxx>:
> 2008/8/21 Clint Adams <clint@xxxxxxx>:
>> 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



Messages sorted by: Reverse Date, Date, Thread, Author