Thread (21 messages) flat view 21 messages, 11 authors, 2016-06-15

Re: Where should git-prompt.sh be installed?

From: Danny Yates <hidden>
Date: 2016-06-15 22:55:06

Would that not give the impression of "git sh-prompt" being a core command? If so, that would be poor, IMHO. 

When I was investigating this last night, I expected to find it (git-prompt.sh) in contrib, although that doesn't make an enormous amount of sense. Ideally, the full path to wherever it's installed should be mentioned in the bash completion file (which is where I went to look when __git_ps1 stopped working), but that would mean modifying a file from upstream and I'm not sure if that's easy/"the done thing".

Danny. 


On 25 Oct 2012, at 01:51, Jonathan Nieder [off-list ref] wrote:
Hi,

In olden days the admin would copy contrib/completion/git-completion.sh
to

       /etc/bash_completion.d/git

and mortals could source /etc/bash_completion or
/etc/bash_completion.d/git in their ~/.bashrc (possibly shared among
multiple machines) so that the bash completion and __git_ps1 helpers
could work.

With Git 1.7.12 __git_ps1 has been split into a separate file, to help
users who only want __git_ps1 to avoid the overhead of loading the
entire completion script (and allow the completion script to be loaded
by bash-completion magic on the fly!).  Now the sysadmin should copy
contrib/completion/git-completion.sh to

   /usr/share/bash-completion/completions/git

and contrib/completion/git-prompt.sh to

   /usr/share/git-core/contrib/?? (somewhere?)

Mortals source /etc/bash_completion in their ~/.bashrc (possibly
shared among multiple machines) and expect bash completion to work.
For __git_ps1, users should source that ?? path.

Questions:

1) what path is appropriate for ?? above?
2) is this documented anywhere?

Possible answers:

1) Fedora uses /etc/profile.d/git-prompt.sh.  Gentoo uses
   /usr/share/bash-completion/git-prompt.  Maybe others use
   some other path.

2) The scripts themselves suggest copying to ~/.git-completion.sh
   and ~/.git-prompt.sh.

Proposal:

 1) /usr/lib/git-core/git-sh-prompt
 2) git-sh-prompt(1)

Sensible?

Thanks,
Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help