git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 23, 2012, 11:53 UTC
Message-ID
<CAMP44s0jLdNo89+c7+fBSokdxhCvPRnRKfhgVKnziMmv0vySXw@mail.gmail.com>
In-Reply-To
<CAOnadRGgduprp_Dbjzf_TsyQQQjivzKxCgUq4y_HevvtKd7h7Q@mail.gmail.com>
On Wed, May 23, 2012 at 12:27 AM, Ted Pavlic <ted@tedpavlic.com> wrote:
Show 9 quoted lines
>> 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).

I didn't attribute it to him, I merely said he proposed it, which he did, I did not make any statement about him being the sole author of this idea.

I don't recall this solution for this problem being proposed in this mailing list by anybody else though. And I don't think it's relevant.

> 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.

This is the reply Kerrick got to his suggestion from Jeff King: http://article.gmane.org/gmane.comp.version-control.git/194230

I also agreed, and so did Jonathan Nieder: http://article.gmane.org/gmane.comp.version-control.git/194950

So I don't see what you mean by those side "discussions" I recall Junio objecting to this, but the split was meant to solve another issue (zsh).

Show 14 quoted lines
> 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.

Perhaps, but it wouldn't work worst than the current __gitdir(). And I haven't heard any better suggestions yet.

> 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)

I like the idea of 'git gitdir' (or 'git dir'), and I dislike the idea of 'git-gitdir.sh'; people would need to copy one extra file, and probably edit multiple files.

>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>
> As the patch is from you, there's no need to sign off on it too.

Yes I do, according to Linux guidelines[1], and that's what I've been always doing in the git mailing list.

Anyway, before going straight to a negative attitude, why don't we wait for more comments before making any conclusions?

Cheers.
[1] http://www.kernel.org/doc/Documentation/SubmittingPatches
-- 
Felipe Contreras
Previous: Ted PavlicNext: Junio C Hamano
Message 17 of 34 in “completion: split into git-prompt.sh”
  1. 0/2 completion: split into git-prompt.shFelipe Contreras, May 22, 2012
  2. 1/2 completion: remove executable modeFelipe Contreras, May 22, 2012
  3. 2/2 completion: split __git_ps1 into a separate scriptFelipe Contreras, May 22, 2012
  4. Zbigniew Jędrzejewski-SzmekMay 22, 2012
  5. Ted PavlicMay 22, 2012
  6. Felipe ContrerasMay 23, 2012
  7. Felipe ContrerasMay 23, 2012
  8. Junio C HamanoMay 23, 2012
  9. Felipe ContrerasMay 23, 2012
  10. Junio C HamanoMay 23, 2012
  11. Ted PavlicMay 23, 2012
  12. Felipe ContrerasMay 23, 2012
  13. Ted PavlicMay 23, 2012
  14. SZEDER GáborMay 24, 2012
  15. SZEDER GáborMay 24, 2012
  16. Ted PavlicMay 22, 2012
  17. Felipe ContrerasMay 23, 2012
  18. Junio C HamanoMay 23, 2012
  19. SZEDER GáborMay 24, 2012
  20. Ville SkyttäMay 25, 2012
  21. Where should git-prompt.sh be installed?Jonathan Nieder, Oct 25, 2012
  22. Drew NorthupOct 25, 2012
  23. Danny YatesOct 25, 2012
  24. __git_ps1: migrate out of contrib/completionJonathan Nieder, Oct 25, 2012
  25. Felipe ContrerasOct 25, 2012
  26. Todd ZullingerNov 8, 2012
  27. Anders KaseorgOct 25, 2012
  28. SZEDER GáborOct 25, 2012
  29. Jonathan NiederOct 25, 2012
  30. Junio C HamanoMay 23, 2012
  31. SZEDER GáborMay 25, 2012
  32. Thomas RastMay 25, 2012
  33. Felipe ContrerasMay 25, 2012
  34. Junio C HamanoMay 25, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.