Re: [PATCH 2/2] completion: enhance "current branch" display

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sonntag, 10. Mai 2009, Michal Nazarewicz wrote:
> Johannes Sixt <j6t@xxxxxxxx> writes:
> > On Sonntag, 10. Mai 2009, Junio C Hamano wrote:
> >>  				b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)..." ||
> >
> > While you are here, you could turn this line into
> >
> > 		{ b=$(< "$g/HEAD") && b=${b:0:7}...; } 2>/dev/null ||
> >
> > to save a process. $(< foo) is a bash feature and does the same as
> > $(cat foo), but faster.
>
> Excuse me this little cavil but how about something that works on other
> shells as well:
>
> { read b <$g/HEAD && _b=${b#???????} && b=${b%"$_b"}... && unset _b }

Because this is all about *bash* completion ;-)

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]