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

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

 



> The solution, proposed by Kerrick Staley[3], is to split the git script
> in two; the part that deals with __git_ps1() in one (i.e.
> git-prompt.sh), and everything else in another (i.e.
> git-completion.bash).

Seems like this solution has popped up on lots of forums for about
every Linux distribution around the time the new bash completion was
introduced. I'm not sure Kerric Staley deserves sole attribution
(sorry Kerrick; I mean no offense).

Moreover, every time the subject of splitting __gitdir out comes up, a
side discussion about all of the complications that could cause comes
up... and people give up and hope that the folks upstream (i.e., here)
will come up with a better solution.

If it was so simple to just split __gitdir out, I think it would have
already been done.

> The only slight issue is that __gitdir() would be duplicated, but this
> is probably not a big deal.

That seems ugly. I know that splitting __gitdir out is also ugly, but
I know that there are going to be a lot more people who use git
completion than git_ps1. Consequently, in a duplicated __gitdir
scneario, I worry that __gitdir will receive more attention and may
relatively quickly diverge in implementation if not very careful in
approving patches. Moreover, a __gitdir of the future may not be
atomic and will pick up side effects and become impossible to manage
in two places.

So maybe a split out "git-gitdir.sh" that both files include would be
"better." Either that or the functionality of "__gitdir" gets pulled
into git itself. (perhaps a git-gitdir added to the main git
distribution)

> Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>

As the patch is from you, there's no need to sign off on it too.

--Ted

-- 
Ted Pavlic <ted@xxxxxxxxxxxxx>
--
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]