/to/repo (BARE:master
This patch fixes the issue by changing the internal field separator
variable IFS to $'\r\n' before using the read builtin command.
Note that ANSI-C Quoting/POSIX Quoting ($'...') is supported by bash
as well as zsh, which are the current targets of git-prompt, cf.
contrib
__git_eread is used to read a single line of a given file (if it exists)
into a single variable stripping the EOL.
This patch removes the unused capability to split file contents into tokens
by passing multiple variable names. Add a comment and explicitly use $2
instead of misleading $@ as
Dear Junio,
I'm amazed at how much time and energy you spend on correcting these
essentially non-issues in my git commit messages for a quadruple-liner
code change.
I'll resend both patches one last time addressing the grave issue of the
informative mention of multi-line files.
Regards,
Robert
Robert Abel writes:
> On 05 Dec 2017 01:27, Junio C Hamano wrote:
>> I know all of the above, but I think you misunderstood the point I
>> wanted to raise, so let me try again. The thing is, none of what
>> you just wrote changes the fact that lack of callers that want to
Hi Junio,
On 05 Dec 2017 01:27, Junio C Hamano wrote:
> I know all of the above, but I think you misunderstood the point I
> wanted to raise, so let me try again. The thing is, none of what
> you just wrote changes the fact that lack of callers that want to do
> "multi-line" is IRRELEVANT.
I
Robert Abel writes:
> Hi Junio,
>
> On 04 Dec 2017 18:58, Junio C Hamano wrote:
>> Robert Abel writes:
>>> __git_eread is used to read a single line of a given file (if it exists)
>>> into a variable without the EOL. All six current users of __git_eread
__git_eread is used to read a single line of a given file (if it exists)
into a single variable without the EOL. All six current users of __git_eread
use it that way and don't expect multi-line content.
Therefore, this patch removes the unused capability to split file conents into
tokens by
If any of the files read by __git_eread have \r\n line endings, read
will only strip \n, leaving \r. This results in an ugly prompt, where
instead of
user@pc MINGW64 /path/to/repo (BARE:master)
the last parenthesis is printed over the beginning of the prompt like
)ser@pc MINGW64
Hi Junio,
On 04 Dec 2017 18:58, Junio C Hamano wrote:
> Robert Abel writes:
>> __git_eread is used to read a single line of a given file (if it exists)
>> into a variable without the EOL. All six current users of __git_eread
>> use it that way and don't expect multi-line
Robert Abel writes:
> __git_eread is used to read a single line of a given file (if it exists)
> into a variable without the EOL. All six current users of __git_eread
> use it that way and don't expect multi-line content.
Changing $@ to $2 does not change whether this is
Hi Robert,
1/2 looks very good.
On Sat, 2 Dec 2017, Robert Abel wrote:
> If any of the files read by __git_eread have \r\n line endings, read
> will only strip \n, leaving \r. This results in an ugly prompt, where
> instead of
>
> user@pc MINGW64 /path/to/repo (BARE:master)
>
> the last
__git_eread is used to read a single line of a given file (if it exists)
into a variable without the EOL. All six current users of __git_eread
use it that way and don't expect multi-line content.
Thus, add a comment and explicitly use $2 instead of shifting the args
down and using $@.
If any of the files read by __git_eread have \r\n line endings, read
will only strip \n, leaving \r. This results in an ugly prompt, where
instead of
user@pc MINGW64 /path/to/repo (BARE:master)
the last parenthesis is printed over the beginning of the prompt like
)ser@pc MINGW64
Hi Robert,
On Thu, 30 Nov 2017, Robert Abel wrote:
> On 30 Nov 2017 16:21, Johannes Schindelin wrote:
> > On Thu, 30 Nov 2017, Robert Abel wrote:
> >> So reading a dummy variable along with the actual content variable
> >> works for git-prompt
On Thu, Nov 30, 2017 at 2:51 AM, Johannes Schindelin
wrote:
> On Thu, 30 Nov 2017, SZEDER Gábor wrote:
>
>> > > diff --git a/contrib/completion/git-prompt.sh
>> > > b/contrib/completion/git-prompt.sh
>> > > index c6cbef38c2..71a64e7959 100644
>> > > ---
Hi Johannes,
On 30 Nov 2017 16:21, Johannes Schindelin wrote:
> On Thu, 30 Nov 2017, Robert Abel wrote:
>> So reading a dummy variable along with the actual content variable
>> works for git-prompt:
>>
>> __git_eread ()
>> {
>> local f="
Hi Robert,
On Thu, 30 Nov 2017, Robert Abel wrote:
> So reading a dummy variable along with the actual content variable
> works for git-prompt:
>
> __git_eread ()
> {
> local f="$1"
> local dummy
> shift
> test -r &quo
|bar: |
0005
Notice the 0d at the end of foo, which didn't get trimmed.
So reading a dummy variable along with the actual content variable
works for git-prompt:
__git_eread ()
{
local f="$1"
local dummy
shift
test -r "$f" && IFS=$'\r\n' read "$@" dummy < "$f"
}
I feel like this would be the most readable solution thus far.
Regards,
Robert
Hi Gábor,
On Thu, 30 Nov 2017, SZEDER Gábor wrote:
> > > diff --git a/contrib/completion/git-prompt.sh
> > > b/contrib/completion/git-prompt.sh
> > > index c6cbef38c2..71a64e7959 100644
> > > --- a/contrib/completion/git-prompt.sh
> > > +++ b/contrib/completion/git-prompt.sh
> > > @@ -282,7
> > diff --git a/contrib/completion/git-prompt.sh
> > b/contrib/completion/git-prompt.sh
> > index c6cbef38c2..71a64e7959 100644
> > --- a/contrib/completion/git-prompt.sh
> > +++ b/contrib/completion/git-prompt.sh
> > @@ -282,7 +282,7 @@ __git_eread ()
> > {
> > local f="$1"
> > shift
>
Hi Robert,
On Wed, 29 Nov 2017, Robert Abel wrote:
> On 29 Nov 2017 15:27, Johannes Schindelin wrote:
>
> > Or maybe keep with the Bash construct, but guarded behind a test that we
> > area actually running in Bash? Something like
> >
> > test -z "$BASH" || IFS=$' \t\r\n'
>
> Actually,
Hi Johannes,
On 29 Nov 2017 15:27, Johannes Schindelin wrote:
>> diff --git a/contrib/completion/git-prompt.sh
>> b/contrib/completion/git-prompt.sh
>> index c6cbef38c2..71a64e7959 100644
>> --- a/contrib/completion/git-prompt.sh
>> +++ b/contrib/completion/git-prompt.sh
>> @@ -282,7 +282,7 @@
Hi Robert,
On Tue, 28 Nov 2017, Robert Abel wrote:
> If any of the files read by __git_eread have \r\n line endings, read
> will only strip \n, leaving \r. This results in an ugly prompt, where
> instead of
>
> user@pc MINGW64 /path/to/repo (BARE:master)
>
> the last parenthesis is printed
If any of the files read by __git_eread have \r\n line endings, read
will only strip \n, leaving \r. This results in an ugly prompt, where
instead of
user@pc MINGW64 /path/to/repo (BARE:master)
the last parenthesis is printed over the beginning of the prompt like
)ser@pc MINGW64
I noticed today that my git prompt using msys-git on Windows got a bit broken.
After investigating I found that the git-prompt doesn't handle the case when
__git_eread reads Windows line endings \r\n. It will only strip \n, leaving
the \r.
I noticed this when I created a repository with msys-git
Junio C Hamano venit, vidit, dixit 15.03.2017 20:25:
> Michael J Gruber <g...@drmicha.warpmail.net> writes:
>
>> git-prompt has various describe styles, among them "describe" (by
>> annotated tags) and "default" (by exact match with any tag).
>
Michael J Gruber <g...@drmicha.warpmail.net> writes:
> git-prompt has various describe styles, among them "describe" (by
> annotated tags) and "default" (by exact match with any tag).
>
> Add a mode "tag" that describes by any tag, annotate
git-prompt has various describe styles, among them "describe" (by
annotated tags) and "default" (by exact match with any tag).
Add a mode "tag" that describes by any tag, annotated or not.
Signed-off-by: Michael J Gruber <g...@drmicha.warpmail.net>
---
Simon Oosthoek writes:
> Hi Andrew
>
> sorry, I only noticed your request this morning...
>
> On 22/04/16 07:00, Andrew Schwartzmeyer wrote:
>> diff --git a/contrib/completion/git-prompt.sh
>> b/contrib/completion/git-prompt.sh
>> index f18aedc73..ffe79168c 100644
>> ---
, you can have colors in
your custom Git prompt function, no problem.
Signed-off-by: Andrew Schwartzmeyer <and...@schwartzmeyer.com>
---
contrib/completion/git-prompt.sh | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/contrib/completion/git-prompt.sh b/c
Hi Rudy,
I think the commit subject should include a bit more detail. Ideally,
the subject would start with 'bash prompt: ' to make it clear what
area the commit involves. Then you would want to describe what
inconsistency is being fixed (and why).
Rudy YAYON wrote:
---
---
contrib/completion/git-prompt.sh | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 07b52be..18be99f 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@
Quoting Cody Taylor cody.tay...@maternityneighborhood.com:
SZEDER Gábor sze...@ira.uka.de writes:
Somehow I had a hard time making sense out of when the current working
directory was not a parent of the untracked file. Perhaps when the
untracked files are outside of the current working
Hi,
Quoting Junio C Hamano gits...@pobox.com:
Cody A Taylor cody.tay...@maternityneighborhood.com writes:
The __git_ps1() prompt function would not show an untracked
state when the current working directory was not a parent of
the untracked file.
Good find, and nicely explained.
Somehow I
SZEDER Gábor sze...@ira.uka.de writes:
Hi,
Quoting Junio C Hamano gits...@pobox.com:
Cody A Taylor cody.tay...@maternityneighborhood.com writes:
The __git_ps1() prompt function would not show an untracked
state when the current working directory was not a parent of
the untracked file.
SZEDER Gábor sze...@ira.uka.de writes:
Somehow I had a hard time making sense out of when the current working
directory was not a parent of the untracked file. Perhaps when the
untracked files are outside of the current working directory would be
easier to grok?
That description doesn't
Cody A Taylor cody.tay...@maternityneighborhood.com writes:
From c861d5cb401110ce7d86b76c1eaa8e89e80f484e Mon Sep 17 00:00:00 2001
From: Cody A Taylor codemiste...@yahoo.com
Date: Thu, 12 Mar 2015 20:36:44 -0400
Subject: [PATCH] git prompt: Use toplevel to find untracked files.
All
From c861d5cb401110ce7d86b76c1eaa8e89e80f484e Mon Sep 17 00:00:00 2001
From: Cody A Taylor codemiste...@yahoo.com
Date: Thu, 12 Mar 2015 20:36:44 -0400
Subject: [PATCH] git prompt: Use toplevel to find untracked files.
The __git_ps1() prompt function would not show an untracked
state when
From 3e4e22e93bf07355b40ba0abcb3a15c4941cfee7 Mon Sep 17 00:00:00 2001
From: Cody A Taylor codemiste...@yahoo.com
Date: Thu, 12 Mar 2015 20:36:44 -0400
Subject: [PATCH] git prompt: Use toplevel to find untracked files.
The __git_ps1() prompt function would not show an untracked
state when
Signed-off-by: Tony Finch d...@dotat.at
---
contrib/completion/git-prompt.sh | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 3c3fc6d..3e70e74 100644
--- a/contrib/completion/git-prompt.sh
+++
SZEDER Gábor sze...@ira.uka.de wrote:
Makes sense, but the patch doesn't cover all cases, because
__git_ps1() can exit early
Thanks for looking at the patch. I feel quite silly for missing the other
return points :-( Follow-up patch on the way...
Tony.
--
f.anthony.n.finch d...@dotat.at
Hi,
Quoting Tony Finch d...@dotat.at:
Signed-off-by: Tony Finch d...@dotat.at
---
contrib/completion/git-prompt.sh | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/contrib/completion/git-prompt.sh
b/contrib/completion/git-prompt.sh
index 3c3fc6d..3e70e74 100644
Hi,
Quoting Tony Finch d...@dotat.at:
If you have a prompt which displays the command exit status,
__git_ps1 without this change corrupts it, although it has
the correct value in the parent shell:
~/src/git (master) 0 $ set | grep ^PS1
PS1='\w$(__git_ps1) $? \$ '
Signed-off-by: Tony Finch d...@dotat.at
---
contrib/completion/git-prompt.sh | 4
1 file changed, 4 insertions(+)
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index c5473dc..5fe69d0 100644
--- a/contrib/completion/git-prompt.sh
+++
Tony Finch d...@dotat.at writes:
Signed-off-by: Tony Finch d...@dotat.at
---
contrib/completion/git-prompt.sh | 4
1 file changed, 4 insertions(+)
diff --git a/contrib/completion/git-prompt.sh
b/contrib/completion/git-prompt.sh
index c5473dc..5fe69d0 100644
---
If you have a prompt which displays the command exit status,
__git_ps1 without this change corrupts it, although it has
the correct value in the parent shell:
~/src/git (master) 0 $ set | grep ^PS1
PS1='\w$(__git_ps1) $? \$ '
~/src/git (master) 0 $ false
~/src/git
Tony Finch d...@dotat.at writes:
If you have a prompt which displays the command exit status,
__git_ps1 without this change corrupts it, although it has
the correct value in the parent shell:
~/src/git (master) 0 $ set | grep ^PS1
PS1='\w$(__git_ps1) $? \$ '
~/src/git
Junio C Hamano gits...@pobox.com wrote:
Yes. I wouldn't have spent 20 minutes experimenting with various
hypothetical use cases if the above were there in the first place.
Sorry for wasting your time, and thanks for reviewing the patch.
(I am so used to having $? in my prompt it took me ages
On Sun, Aug 24, 2014 at 08:22:41PM +0700, Gábor Szeder wrote:
On Aug 23, 2014 12:26 PM, Jeff King p...@peff.net wrote:
Since dd0b72c (bash prompt: use bash builtins to check stash
state, 2011-04-01), git-prompt checks whether we have a
stash by looking for $GIT_DIR/refs/stash. Generally
Hi,
On Aug 23, 2014 12:26 PM, Jeff King p...@peff.net wrote:
Since dd0b72c (bash prompt: use bash builtins to check stash
state, 2011-04-01), git-prompt checks whether we have a
stash by looking for $GIT_DIR/refs/stash. Generally external
programs should never do this, because they would
Since dd0b72c (bash prompt: use bash builtins to check stash
state, 2011-04-01), git-prompt checks whether we have a
stash by looking for $GIT_DIR/refs/stash. Generally external
programs should never do this, because they would miss
packed-refs.
That commit claims that packed-refs does not pack
Hi,
On Thu, Jun 27, 2013 at 10:31:57PM -0300, Eduardo R. D'Avila wrote:
The merged result is ok!
Yeah, it look good, thanks.
Gábor
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at
SZEDER Gábor sze...@ira.uka.de writes:
On Thu, Jun 27, 2013 at 10:31:57PM -0300, Eduardo R. D'Avila wrote:
The merged result is ok!
Yeah, it look good, thanks.
Thanks, both, for double checking (and thank you for preparing the
pre-merged results).
--
To unsubscribe from this list: send the
Hi Junio,
The merged result is ok!
Thanks,
Eduardo
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
for git-prompt pcmode
git-prompt.sh: refactor colored prompt code
t9903: remove redundant tests
git-prompt.sh: do not print duplicate clean color code
git-prompt.sh: add missing information in comments
contrib/completion/git-prompt.sh | 111 --
t/t9903-bash-prompt.sh
git-prompt.sh lacks tests for PROMPT_COMMAND mode.
Add tests for:
* pcmode prompt without colors
* pcmode prompt with colors for bash
* pcmode prompt with colors for zsh
Having these tests enables an upcoming refactor in
a safe way.
Signed-off-by: Eduardo R. D'Avila erdav...@gmail.com
---
254
On Sat, Jun 22, 2013 at 01:32:38PM -0300, Eduardo D'Avila wrote:
These tests where important to make sure that I wouldn't break anything during
the refactorization. Having them pass before *and* after refactorization
guarantees that nothing was broken (except for some subtle case that might
Eduardo D'Avila erdav...@gmail.com writes:
However, I agree that they became redundant.
Would it make sense to include a patch that only removes the zsh
tests, after the refactorization?
I think that would be a sensible thing to do.
In any case, Szeder seems to be giving a good guidance on
Hi,
On Thu, Jun 20, 2013 at 11:25:26PM -0300, Eduardo R. D'Avila wrote:
git-prompt.sh lacks tests for PROMPT_COMMAND mode.
Add tests for:
* pcmode prompt without colors
* pcmode prompt with colors for bash
* pcmode prompt with colors for zsh
Having these tests enables an upcoming
2013/6/22 SZEDER Gábor sze...@ira.uka.de:
On Thu, Jun 20, 2013 at 11:25:26PM -0300, Eduardo R. D'Avila wrote:
git-prompt.sh lacks tests for PROMPT_COMMAND mode.
Add tests for:
* pcmode prompt without colors
* pcmode prompt with colors for bash
* pcmode prompt with colors for zsh
Having
git-prompt.sh lacks tests for PROMPT_COMMAND mode.
Add tests for:
* pcmode prompt without colors
* pcmode prompt with colors for bash
* pcmode prompt with colors for zsh
Having these tests enables an upcoming refactor in
a safe way.
Signed-off-by: Eduardo R. D'Avila erdav...@gmail.com
---
254
-control.git/228308 .
Some of the patches could still be used, so I'm
reposting them with an additional one to add some
missing information in usage comments.
Eduardo R. D'Avila (4):
t9903: add tests for git-prompt pcmode
git-prompt.sh: refactor colored prompt code
git-prompt.sh: do
git-prompt.sh lacks tests for PROMPT_COMMAND mode.
Add tests for:
* pcmode prompt without colors
* pcmode prompt with colors for bash
* pcmode prompt with colors for zsh
Having these tests enables an upcoming refactor in
a safe way.
Signed-off-by: Eduardo R. D'Avila erdav...@gmail.com
---
254
git-prompt.sh lacks tests for PROMPT_COMMAND mode.
Add tests for:
* pcmode prompt without colors
* pcmode prompt with colors for bash
* pcmode prompt with colors for zsh
Having these tests enables an upcoming refactor in
a safe way.
Signed-off-by: Eduardo R. D'Avila erdav...@gmail.com
---
250
Eduardo R. D'Avila erdav...@gmail.com writes:
git-prompt.sh lacks tests for PROMPT_COMMAND mode.
Add tests for:
* pcmode prompt without colors
* pcmode prompt with colors for bash
* pcmode prompt with colors for zsh
Having these tests enables an upcoming refactor in
a safe way.
Ethan Reesor wrote:
I have a git user set up on my server. It's prompt is set to
git-prompt and it's git-shell-commands is empty.
[...]
How do I make the git user work like github where, upon attempting to
get a prompt, the connection is closed?
I assume you mean that the user's login shell
On Sun, Feb 10, 2013 at 01:25:38PM -0800, Jonathan Nieder wrote:
Ethan Reesor wrote:
I have a git user set up on my server. It's prompt is set to
git-prompt and it's git-shell-commands is empty.
[...]
How do I make the git user work like github where, upon attempting to
get a prompt
On Mon, Feb 11, 2013 at 4:24 AM, Junio C Hamano gits...@pobox.com wrote:
Jeff King p...@peff.net writes:
On Sun, Feb 10, 2013 at 01:25:38PM -0800, Jonathan Nieder wrote:
Ethan Reesor wrote:
I have a git user set up on my server. It's prompt is set to
git-prompt and it's git-shell
GIT_PS1_DESCRIBE_STYLE was introduced in v1.6.3.2~35. Document it in the
header comments.
Signed-off-by: Anders Kaseorg ande...@mit.edu
---
contrib/completion/git-prompt.sh | 9 +
1 file changed, 9 insertions(+)
diff --git a/contrib/completion/git-prompt.sh
Anders Kaseorg ande...@mit.edu writes:
GIT_PS1_DESCRIBE_STYLE was introduced in v1.6.3.2~35. Document it in the
header comments.
Signed-off-by: Anders Kaseorg ande...@mit.edu
---
Thanks.
contrib/completion/git-prompt.sh | 9 +
1 file changed, 9 insertions(+)
diff --git
git-svn reads usernames and other user queries from an interactive
terminal. This cause GUIs (w/o STDIN connected) to hang waiting forever
for git-svn to complete
(http://code.google.com/p/tortoisegit/issues/detail?id=967).
This change extends the Git::prompt helper, so that it can also be used
Am 04.01.2012 01:12 schrieb Junio C Hamano:
Now prompt is no longer a method but is merely a helper function, so
I've queued this (and 1/2 rewrite we discussed in a separate thread) to
'pu' after rewording the commit log message.
Thanks.
Is there a reason why these changes did not get
Sven Strickroth sven.strickr...@tu-clausthal.de writes:
Am 04.01.2012 01:12 schrieb Junio C Hamano:
Now prompt is no longer a method but is merely a helper function, so
I've queued this (and 1/2 rewrite we discussed in a separate thread) to
'pu' after rewording the commit log message.
73 matches
Mail list logo