Re: git stash syntax error under AIX 5.3
- From
- Brian Riehman <briehman@gmail.com>
- Date
- Nov 3, 2010, 15:29 UTC
- Message-ID
- <AANLkTi=V7nu98xHVrVJuZqt_3hajMPvkk=AKB0HnOD-_@mail.gmail.com>
- In-Reply-To
- <20101103150718.GA12733@burratino>
Thanks, Jonathan. That did indeed fix it. Thanks for your help and clarification that it does indeed work in my shell when escaped properly.
On Wed, Nov 3, 2010 at 10:07 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 31 quoted lines
> 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
>