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.
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
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 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)
The third step doesn't seem necessary if .git-completion sources
git-prompt when it's available (and otherwise ignores it gracefully).
Then anyone who cares about the prompt just makes sure that git-prompt
is available.
--
Ted Pavlic [off-list ref]
From: Felipe Contreras <hidden> Date: 2016-06-15 22:53:53
On Wed, May 23, 2012 at 7:03 PM, Ted Pavlic [off-list ref] wrote:
quoted
quoted
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 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)
The third step doesn't seem necessary if .git-completion sources
git-prompt when it's available (and otherwise ignores it gracefully).
Then anyone who cares about the prompt just makes sure that git-prompt
is available.
And then anything that uses __gitdir() would fail.
And how would you figure if it's available, and where it is available?
What if git-completion.bash is distributed on
/usr/share/bash-completion/completions/git? Where would you put
git-prompt.sh so it can be found *and* you would not require
modifications? And what if I want to put the latest version on
~/.git-completion.sh (as the script actually suggests).
There's no way git-prompt.sh can be sourced without modifications to
the script, unless you expect it would always be named
'.git-prompt.sh' and would be on the same directory, which many
distributions would frown upon.
--
Felipe Contreras
There's no way git-prompt.sh can be sourced without modifications to
the script, unless you expect it would always be named
'.git-prompt.sh' and would be on the same directory, which many
distributions would frown upon.
So, again, seems like a good argument for building a git-gitdir into git
proper. Maybe there are other utilities that could make use of it as
well...
--
Ted Pavlic [off-list ref]
From: SZEDER Gábor <hidden> Date: 2016-06-15 22:53:54
Hi,
On Wed, May 23, 2012 at 05:55:13PM -0400, Ted Pavlic wrote:
quoted
There's no way git-prompt.sh can be sourced without modifications to
the script, unless you expect it would always be named
'.git-prompt.sh' and would be on the same directory, which many
distributions would frown upon.
So, again, seems like a good argument for building a git-gitdir into git
proper. Maybe there are other utilities that could make use of it as
well...
You mean a real git command, which does the same as __gitdir()? I
don't like that, because it will always require 2 fork()s and an
exec() and would be slow on Windows.
Best,
Gábor
From: SZEDER Gábor <hidden> Date: 2016-06-15 22:53:54
On Wed, May 23, 2012 at 05:40:46PM +0200, Felipe Contreras wrote:
What do we gain by this incredible user annoyance? Less maintenance
burden of __gitdir() which barely changes anyway?
I happen to have a topic in the works which changes __gitdir() and
adds some helper functions to it, so the diffstat of all
__gitdir()-related changes is this:
1 file changed, 71 insertions(+), 6 deletions(-)
Gábor