Thread (7 messages) flat view 7 messages, 4 authors, 2016-06-15

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

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:53:53

Hi,

On Wed, May 23, 2012 at 4:54 PM, Junio C Hamano [off-list ref] wrote:
Zbigniew Jędrzejewski-Szmek  [off-list ref] writes:
quoted
On 05/22/2012 10:46 PM, Felipe Contreras wrote:
quoted
 contrib/completion/git-completion.bash |  257 +---------------------------
 contrib/completion/git-prompt.sh       |  287 ++++++++++++++++++++++++++++++++
 t/t9903-bash-prompt.sh                 |    2 +-
 3 files changed, 290 insertions(+), 256 deletions(-)
 create mode 100644 contrib/completion/git-prompt.sh
Hi,
since git-prompt is not completion related anymore, should a different
directory be used?
I am not sure if that is worth it.  These two share/duplicate some shell
functions and we may end up refactoring them (a way to do so may be to
dot-source git-prompt from git-completion and drop duplicated definitions
from the latter), for example.
And how do you propose to update the install documentation?

#    1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
#    2) Add the following line to your .bashrc/.zshrc:
#        source ~/.git-completion.sh
#
#    3) Consider changing your PS1 to also show the current branch:

1) Copy the file (e.g. ~/.git-completion.sh)
2) Copy the other file (.e.g ~/.git-prompt.sh)
3) Edit the original file (~/.git-completion.sh), modify the 'source'
command to use the other file (~/.git-prompt.sh)

And if the user doesn't care about prompt this certainly looks like overkill.

What do we gain by this incredible user annoyance? Less maintenance
burden of __gitdir() which barely changes anyway?

What about 'git dir' or 'git info dir' (this could be used by other
scripts to get information about various git commands, for completion,
documentation, what not)?

Cheers.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help