git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-prompt.sh: show the upstream abbrev name

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Oct 15, 2013, 12:21 UTC
Message-ID
<20131015122111.GT19704@goldbirke>
In-Reply-To
<5256BD0A.30706@gmail.com>
On Thu, Oct 10, 2013 at 04:43:22PM +0200, Julien Carsique wrote:
> It's fixed.
Thanks, the updated patch looks good to me.
> Note '+=' was already used line 114:
> 
>             svn_url_pattern+="\\|$value"

I guess noone has tried to use the upstream status indicator with an SVN upstream and an ancient Bash version yet, thanks for pointing it out.

-- >8 --
Subject: [PATCH] bash prompt: don't use '+=' operator in show upstream code path

The '+=' operator is not supported by old Bash versions (3.0) we still care about.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-prompt.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 202e2e520f..7b732d2aeb 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -111,7 +111,7 @@ __git_ps1_show_upstream ()
 			;;
 		svn-remote.*.url)
 			svn_remote[$((${#svn_remote[@]} + 1))]="$value"
-			svn_url_pattern+="\\|$value"
+			svn_url_pattern="$svn_url_pattern\\|$value"
 			upstream=svn+git # default upstream is SVN if available, else git
 			;;
 		esac
-- 
1.8.4.1.495.gd8d272e
Previous: Julien Carsique
Message 5 of 5 in “git-prompt.sh: show the upstream abbrev name”
  1. git-prompt.sh: show the upstream abbrev nameJulien Carsique, Oct 10, 2013
  2. SZEDER GáborOct 10, 2013
  3. git-prompt.sh: show the upstream abbrev nameJulien Carsique, Oct 10, 2013
  4. Julien CarsiqueOct 10, 2013
  5. SZEDER GáborOct 15, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.