Re: [PATCH 2/2] completion: split __git_ps1 into a separate script

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

 



SZEDER Gábor <szeder@xxxxxxxxxx> writes:

> On Thu, May 24, 2012 at 11:36:45PM -0400, Ted Pavlic wrote:
>> > You mean a real git command, which does the same as __gitdir()?  I
>> > don't like that, because it will always require 2 fork()s and an
>> > exec() and would be slow on Windows.
>> 
>> Interesting. I guess I didn't realize bash completion was an issue for most
>> Windows users. Is it?
>
> It is.  Emulating fork() and exec() is very expensive, so every
> subshell, external command, or especially git command in a command
> substitution costs dearly.  And the completion script uses many git
> commands and even more subshells.
>
> Case in point is __git_ps1() and __gitdir().  There are scenarios
> where displaying the git-specific bash prompt takes more than 400ms on
> Windows, while displaying the same prompt takes only about 26ms on
> Linux on the same hardware.
>
>   http://thread.gmane.org/gmane.comp.version-control.git/197432

Why not make a git builtin command that figures out everything that
__git_ps1 does?  Perhaps in a format that can be eval'd and processed to
the user's taste.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
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]