[Mingw-users] Shell is stripping curly braces in Git for Windows

Back to archive index

Robert Dailey rcdai****@gmail*****
Sun Apr 15 01:30:17 JST 2018


On Sat, Apr 14, 2018 at 5:13 AM, Keith Marshall <keith****@users*****> wrote:
> What is the shell?  If its GNU bash, (as our MSYS shell would be),
> then braces are special; bash performs brace expansion on the comma
> separated list within them, (and in this case, there's only one item
> in the list).  You need to quote the final argument, to suppress the
> effect of brace expansion.
>
>>> This results in:
>>>
>>> "git myalias @-1"
>
> This is exactly the result I would expect, after brace expansion of
> the single item list "-1".

I use the default git bash that it comes with, which I think is
exactly as you state (gnu bash + msys). It seems that {-1} was only
treated as a valid brace expansion as of a year or so ago, because
passing in @{-1} used to not be processed by bash as an expansion. The
unfortunate issue here is that @{...} syntax is a valid way to specify
git revisions (e.g. HEAD@{1} for index 1 in reflogs, @{-1} for
previous checkout, etc). I've never had to quote or escape these.
Having to do that now makes git commands less intuitive and makes
typing those commands more frustrating.

Is there a way to globally disable brace expansion in bash? Maybe some
MSYS specific configuration? Anything to help here?

Thanks for your response.




More information about the MinGW-Users mailing list
Back to archive index