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

Back to archive index

Robert Dailey rcdai****@gmail*****
Sun Apr 15 01:32:11 JST 2018


On Sat, Apr 14, 2018 at 11:30 AM, Robert Dailey
<rcdai****@gmail*****> wrote:
> 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.

Also worth noting that bash on Ubuntu, for example, does not process
this same syntax as a brace expansion. Presumably they should behave
identically. Why would GNU bash process {-1} as a brace expansion but
not Ubuntu's version of bash? This is what makes me think it's a bug,
that plus the fact that brace expansion in this case was never working
properly until 1 year ago (assuming the current behavior is
"correct").




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