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

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

 



Hi,

On Wed, May 23, 2012 at 4:54 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Zbigniew Jędrzejewski-Szmek  <zbyszek@xxxxxxxxx> writes:
>
>> On 05/22/2012 10:46 PM, Felipe Contreras wrote:
>>>  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
--
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]