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

Re: git stash syntax error under AIX 5.3

From
BRBrian 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
>
Previous: Jonathan Nieder
Message 3 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.