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

Re: [PATCH] _git: Also complete FETCH_HEAD, ORIG_HEAD and MERGE_HEAD.



On Sun, Mar 21, 2010 at 09:17:25PM +0100, Nikolai Weibull wrote:
> On Sun, Mar 21, 2010 at 20:48, Benjamin R. Haskell wrote:
>
>> +  symbolic_heads=()
>> +  for head in HEAD ORIG_HEAD FETCH_HEAD MERGE_HEAD ; do
>> +    git rev-parse $head &>/dev/null && symbolic_heads+=( $head )
>> +  done
>
> Thatâs a lot of forking to make a simple check.  Is there no better
> way?  Do we actually have to filter the heads?

I don't know the _git completion code, but couldn't we just check
if .git/{ORIG_HEAD,FETCH_HEAD,MERGE_HEAD} exists? This should
work for most things.

Another possibility would be to just complete them all the time.

Simon
-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9

Attachment: pgpsrQFiLkJBS.pgp
Description: PGP signature



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