Skip to contentSkip to conversation

Add bare repository indicator for __git_ps1

PATCH In review Marius Storm-Olsen 5 participants 9 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add bare repository indicator for __git_ps1

Prefixes the branch name with "BARE:" if you're in a bare repository.

---
Patch tried sent via ThunderGit extension. Sorry if it's mangled :-)

contrib/completion/git-completion.bash | 10 ++++++++--

1 files changed, 8 insertions(+), 2 deletions(-)
contrib/completion/git-completion.bash +0 -0
index 0a3092f..c741203 100755
@@ -138,10 +138,16 @@ __git_ps1 ()

fi
fi

+ local c
+
+ if test "$(git config --bool core.bare)" == "true"; then
+ c="BARE:"
+ fi
+

		if [ -n "${1-}" ]; then

- printf "$1" "${b##refs/heads/}$w$i$r"
+ printf "$1" "$c${b##refs/heads/}$w$i$r"
else
- printf " (%s)" "${b##refs/heads/}$w$i$r"
+ printf " (%s)" "$c${b##refs/heads/}$w$i$r"
fi
fi
}

Signature · 1 line
1.6.2.rc1.20.g8c5b
#1 lore raw
Quoted 3 lines

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Lightning/0.9 Thunderbird/2.0.0.19 ThunderGit/0.1a Mnenhy/0.7.6.666

Marius Storm-Olsen venit, vidit, dixit 20.02.2009 15:56:

Quoted 5 lines

Prefixes the branch name with "BARE:" if you're in a bare repository.

tried sent via ThunderGit extension. Sorry if it's mangled :-)

Now what's that ThunderGit thingy? ;)

Seriously, I see you and Dscho have been carrying this on, and soon external commands may be lauched. Is this going in a git specific direction rather than attaching patch files unmangled (UnflowedTB)?

Michael

#2 lore raw

Michael J Gruber said the following on 20.02.2009 17:39:

Quoted 3 lines
Quoted 3 lines

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Lightning/0.9 Thunderbird/2.0.0.19 ThunderGit/0.1a Mnenhy/0.7.6.666

Heh, you noticed the user-agent extra \o/ :-)

Quoted 11 lines

Marius Storm-Olsen venit, vidit, dixit 20.02.2009 15:56:

Quoted 5 lines

Prefixes the branch name with "BARE:" if you're in a bare repository.

Patch tried sent via ThunderGit extension. Sorry if it's mangled :-)

Now what's that ThunderGit thingy? ;)

Seriously, I see you and Dscho have been carrying this on, and soon
external commands may be lauched. Is this going in a git specific direction rather than attaching patch files unmangled (UnflowedTB)?

Well, Dscho's intentions was, as the project name says, to simply send patches unflowed. I have, however, had many other features which I would like to see in a Git extension, which is why called it ThunderGit instead. First I want the extension to help with Best Practices for sending patches. Second, I want the extension to have neatness like:

1) Saving a whole patch series as a mailbox, for easy apply. Maybe even a "create new branch based on <branch>, and apply series" feature? ^shrug^

2) Send patch (series) based on a selected email (ie. setting "references" based on selection)

3) Showing Git patches with diff coloring (maybe also in the editor, but mostly for received mails)

4) Basic validation of patch before sending, like
a) trailing whitespace
b) consistent preceding whitespaces
c) <add favorite>

This is my first extension though, so any help from people "in the know" would be great!

If all attempts fail to make the extension fool proof wrt sending proper unflowed patches, we could always just use Thunderbird as the front-end for 'git send-email' ;-) I'm almost tempted to already go that route, simply to avoid all the hassle. Then we could also just use the plaintext composer, instead of the HTML composer which isn't exactly "fool proof" for plaintext patches.

--
.marius

#3 lore raw
In reply to Marius Storm-Olsen

Review

Quoted 1 line
(quoted diff) +1 -0
+		if test "$(git config --bool core.bare)" == "true"; then

As discussed in another thread, to be consistent with local coding convention, "test" should be replaced with "[ ... ]".

Additionally, double equality (==) should be replaced with single equality (=).

--Ted

Signature · 5 lines
Ted Pavlic <[email protected]>

  Please visit my ALS association page:
        http://web.alsa.org/goto/tedpavlic
  My family appreciates your support in the fight to defeat ALS.
#4 lore raw

Ted Pavlic said the following on 20.02.2009 18:06:

Quoted 6 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+		if test "$(git config --bool core.bare)" == "true"; then

As discussed in another thread, to be consistent with local coding
convention, "test" should be replaced with "[ ... ]".

Additionally, double equality (==) should be replaced with single equality (=).

Ok, I think I was based off of master at the time. I'll take a closer look. Thanks!

--
.marius

#6 lore raw
Quoted 9 lines · Johannes Schindelin

Hi,

Quoted 3 lines · Marius Storm-Olsen
(quoted diff) +2 -0
+		local c
+		+		if test "$(git config --bool core.bare)" ==

"true"; then

Indeed, it seems that this got mangled, unfortunately.

Actually it seems the patch itself is fine, but the mail is still flagged format=flowed, so f=f-aware readers will mangle it on display.

It conflicts with e5dd864 (completion: Better __git_ps1 support when not in working directory, 2009-02-11) however, which is on next.

Signature · 2 lines
Thomas Rast
trast@{inf,student}.ethz.ch
#7 lore raw

Thomas Rast venit, vidit, dixit 20.02.2009 17:46:

Quoted 5 lines
Quoted 4 lines · Johannes Schindelin

Hi,

On Fri, 20 Feb 2009, Marius Storm-Olsen wrote:

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines
(quoted diff) +2 -0
+		local c
+		+		if test "$(git config --bool core.bare)" ==

"true"; then

Indeed, it seems that this got mangled, unfortunately.

Actually it seems the patch itself is fine, but the mail is still flagged format=flowed, so f=f-aware readers will mangle it on display.

Unmangled here also, viewing with TB, f-f disabled or not, unless I make the window very small of course.

Michael

#8 lore raw
In reply to Thomas Rast

Thomas Rast said the following on 20.02.2009 17:46:

Quoted 9 lines
Quoted 5 lines · Johannes Schindelin
Quoted 3 lines · Marius Storm-Olsen
(quoted diff) +2 -0
+		local c
+		+		if test "$(git config --bool core.bare)" ==

"true"; then

Indeed, it seems that this got mangled, unfortunately.

Actually it seems the patch itself is fine, but the mail is still flagged format=flowed, so f=f-aware readers will mangle it on display.

Hmm, it looks ok for me as well, though I do see the incorrect format=flowed for this unflowed mail. I think it's one of my other extensions causing this, but I'm not sure. I need to disable them to check.

Quoted 3 lines

It conflicts with e5dd864 (completion: Better __git_ps1 support when not in working directory, 2009-02-11) however, which is on next.

Ok, I think I was based on master. I'll rebase and do fixups on Monday.

Thanks!

--
.marius