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