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

Re: git stash syntax error under AIX 5.3

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 3, 2010, 15:07 UTC
Message-ID
<20101103150718.GA12733@burratino>
In-Reply-To
<AANLkTimSpPLfqv07+Tmcj-iM0W+p86V2-HRrq71Umdtr@mail.gmail.com>
Hi Brian,
Brian Riehman wrote:
> The stash command relies on bash-specific shell scripting techniques

Git actually uses the ${var%glob} syntax pretty widely, and it is fairly portable (see http://unix.org/2008edition/ and search for "sh -" for details). I suspect the problem is rather the seemingly-unbalanced braces:

> <       if test "${REV}" != "${REV%{*\}}"
How about this patch?
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
diff --git a/git-stash.sh b/git-stash.sh
index 5fb1245..0a41226 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -311,7 +311,7 @@ parse_flags_and_rev()
 	test "$ref_stash" = "$(git rev-parse --symbolic-full-name "${REV%@*}")" &&
 	IS_STASH_REF=t
 
-	if test "${REV}" != "${REV%{*\}}"
+	if test "${REV}" != "${REV%\{*\}}"
 	then
 		# maintainers: it would be better if git rev-parse indicated
 		# this condition with a non-zero status code but as of 1.7.2.1 it
Previous: Brian RiehmanNext: Brian Riehman
Message 2 of 3 in “git stash syntax error under AIX 5.3”
  1. Brian RiehmanNov 3, 2010
  2. Jonathan NiederNov 3, 2010
  3. Brian RiehmanNov 3, 2010

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.