GNU bug report logs - #9480
24.0.50; (vc-git) stash@{n} - requires shell quoting?

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Mon, 12 Sep 2011 07:15:01 UTC

Severity: normal

Merged with 9784

Found in version 24.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9480 in the body.
You can then email your comments to 9480 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Mon, 12 Sep 2011 07:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jambunathan K <kjambunathan <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 12 Sep 2011 07:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Mon, 12 Sep 2011 12:39:43 +0530
[Message part 1 (text/plain, inline)]
While in a *vc-dir* buffer (backed by git) and trying to show or apply a
stash fails.

I am attaching "works for me" patch that shell-quotes stash@{n}
argument. With this "patch", the stash commands work as expected.

My shell-file-name is set to "bash" (cygwin version). My Emacs is

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-09-06 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt'

Additional Info:

,----
| VC backend : Git
| Working dir: ~/src/org-mode/
| Branch     : master
| Remote     : orgmode <at> orgmode.org:org-mode.git
| Stash      :
|              {0}: On master: custom tables  <-----
`----

FWIW, the stash line has following keymap:

,----
| (keymap
|  (83 . vc-git-stash-snapshot)
|  (80 . vc-git-stash-pop-at-point)
|  (65 . vc-git-stash-apply-at-point)
|  (13 . vc-git-stash-show-at-point)
|  (61 . vc-git-stash-show-at-point)
|  (11 . vc-git-stash-delete-at-point)
|  (down-mouse-3 . vc-git-stash-menu)
|  (mouse-2 . ignore))
`----

[vc-git.el.patch (text/x-patch, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Mon, 12 Sep 2011 07:34:02 GMT) Full text and rfc822 format available.

Message #8 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 9480 <at> debbugs.gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Mon, 12 Sep 2011 03:29:18 -0400
> From: Jambunathan K <kjambunathan <at> gmail.com>
> Date: Mon, 12 Sep 2011 12:39:43 +0530
> 
> While in a *vc-dir* buffer (backed by git) and trying to show or apply a
> stash fails.
> 
> I am attaching "works for me" patch that shell-quotes stash@{n}
> argument. With this "patch", the stash commands work as expected.
> 
> My shell-file-name is set to "bash" (cygwin version). My Emacs is
> 
> In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)

Can you tell what does git see as its arguments without the quoting?
I would like to establish whether this is some bug specific to the
Windows build of Emacs, since other systems that use Bash evidently
don't need this change.

TIA




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Mon, 12 Sep 2011 09:11:02 GMT) Full text and rfc822 format available.

Message #11 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9480 <at> debbugs.gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Mon, 12 Sep 2011 14:35:48 +0530
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Jambunathan K <kjambunathan <at> gmail.com>
>> Date: Mon, 12 Sep 2011 12:39:43 +0530
>> 
>> While in a *vc-dir* buffer (backed by git) and trying to show or apply a
>> stash fails.
>> 
>> I am attaching "works for me" patch that shell-quotes stash@{n}
>> argument. With this "patch", the stash commands work as expected.
>> 
>> My shell-file-name is set to "bash" (cygwin version). My Emacs is
>> 
>> In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
>
> Can you tell what does git see as its arguments without the quoting?
> I would like to establish whether this is some bug specific to the
> Windows build of Emacs, since other systems that use Bash evidently
> don't need this change.

With the failing setup and
(setq vc-command-messages t)

I see the following in the *Messages* buffer and it seems OK to me

,----  *Messages* 
| Running git update-index --refresh . in background... done
| Running git diff-index --relative -z -M HEAD -- . in background... done
| Running git ls-files -z -o --directory --no-empty-directory --exclude-standard -- . in background... done
| Running git stash show -p stash@{0} . in background... done
`----

But in the *vc-git-stash* buffer I see the following message

,----  *vc-git-stash* 
| '-p stash <at> 0' is not a stash
`----

Not the absence of `{' `}' in the error report. I hope that provides
some clue on what the underlying git sees.


With my "works for me" changes, I see the following

,---- *Messages*
| Running git stash show -p stash\@\{0\} . in background... done
`----

,---- *vc-git-stash*
| diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el
| index 5bc73a7..91c98ea 100644
| --- a/contrib/lisp/org-odt.el
| +++ b/contrib/lisp/org-odt.el
| @@ -636,7 +636,28 @@ PUB-DIR is set, use this as the publishing directory."
|  (defvar org-lparse-table-is-styled)
|  (defvar org-lparse-table-rowgrp-info)
|  (defvar org-lparse-table-colalign-vector)
| +
| [snip]
`----

Let me know if you need more information.

FWIW, git is also from cygwin installation.

Jambunathan K.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Mon, 12 Sep 2011 10:56:01 GMT) Full text and rfc822 format available.

Message #14 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 9480 <at> debbugs.gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Mon, 12 Sep 2011 06:51:30 -0400
> From: Jambunathan K <kjambunathan <at> gmail.com>
> Cc: 9480 <at> debbugs.gnu.org
> Date: Mon, 12 Sep 2011 14:35:48 +0530
> 
> | Running git stash show -p stash@{0} . in background... done
> `----
> 
> But in the *vc-git-stash* buffer I see the following message
> 
> ,----  *vc-git-stash* 
> | '-p stash <at> 0' is not a stash
> `----
> 
> Not the absence of `{' `}' in the error report. I hope that provides
> some clue on what the underlying git sees.

Yes, I see the problem, but now I wonder how come users of Posix
platforms didn't see it.  Does it happen if your shell-file-name is
set to "sh", not "bash" (assuming the Cygwin Bash comes with such an
executable or a link)?

Perhaps someone who uses this on Unix or GNU system could try this
command and see if it needs quoting in general, not just on Windows
with Cygwin Bash.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Mon, 12 Sep 2011 11:28:02 GMT) Full text and rfc822 format available.

Message #17 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9480 <at> debbugs.gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Mon, 12 Sep 2011 16:52:59 +0530
> Yes, I see the problem, but now I wonder how come users of Posix
> platforms didn't see it.  Does it happen if your shell-file-name is
> set to "sh", not "bash" (assuming the Cygwin Bash comes with such an
> executable or a link)?

sh and bash are apparently one and the same executable.

,----
| sh-3.2$ bash --version
| GNU bash, version 3.2.51(24)-release (i686-pc-cygwin)
| Copyright (C) 2007 Free Software Foundation, Inc.
| 
| sh-3.2$ sh --version
| GNU bash, version 3.2.51(24)-release (i686-pc-cygwin)
| Copyright (C) 2007 Free Software Foundation, Inc.
| 
| 
| sh-3.2$ pwd
| /usr/bin
| 
| sh-3.2$ diff --binary sh.exe bash.exe
|
| sh-3.2$ ls -al sh.exe
| -rwxr-xr-x 1 kjambunathan root 470542 Aug 13  2010 sh.exe
|
| sh-3.2$ ls -al bash.exe
| -rwxr-xr-x 1 kjambunathan root 470542 Aug 13  2010 bash.exe
`----






Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Mon, 12 Sep 2011 11:56:01 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Antoine Levitt <antoine.levitt <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Mon, 12 Sep 2011 13:50:56 +0200
12/09/11 13:22, Jambunathan K
>> Yes, I see the problem, but now I wonder how come users of Posix
>> platforms didn't see it.  Does it happen if your shell-file-name is
>> set to "sh", not "bash" (assuming the Cygwin Bash comes with such an
>> executable or a link)?
>
> sh and bash are apparently one and the same executable.

Bash runs in sh compatibility mode when invoked with "sh". From man bash:

       If bash is invoked with the name sh, it tries to mimic the
       startup behavior of historical versions of sh as closely as
       possible, while conforming to the POSIX standard as well.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Mon, 12 Sep 2011 12:02:02 GMT) Full text and rfc822 format available.

Message #23 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Antoine Levitt <antoine.levitt <at> gmail.com>
Cc: 9480 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Mon, 12 Sep 2011 07:56:43 -0400
> From: Antoine Levitt <antoine.levitt <at> gmail.com>
> Date: Mon, 12 Sep 2011 13:50:56 +0200
> 
> 12/09/11 13:22, Jambunathan K
> >> Yes, I see the problem, but now I wonder how come users of Posix
> >> platforms didn't see it.  Does it happen if your shell-file-name is
> >> set to "sh", not "bash" (assuming the Cygwin Bash comes with such an
> >> executable or a link)?
> >
> > sh and bash are apparently one and the same executable.
> 
> Bash runs in sh compatibility mode when invoked with "sh". From man bash:
> 
>        If bash is invoked with the name sh, it tries to mimic the
>        startup behavior of historical versions of sh as closely as
>        possible, while conforming to the POSIX standard as well.

Right.  So results could be different, even though it's the same
binary.  Jambunathan, please try that if you can.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 01:45:02 GMT) Full text and rfc822 format available.

Message #26 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 9480 <at> debbugs.gnu.org, eliz <at> gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Mon, 12 Sep 2011 21:39:49 -0400
    sh and bash are apparently one and the same executable.

That is a bad practice -- the file's name should not change its
behavior.  They ought to be two executables.

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use free telephony http://directory.fsf.org/category/tel/




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 04:08:01 GMT) Full text and rfc822 format available.

Message #29 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9480 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 00:03:10 -0400
Eli Zaretskii wrote:

> Perhaps someone who uses this on Unix or GNU system could try this
> command and see if it needs quoting in general, not just on Windows
> with Cygwin Bash.

FWIW, I can only find (t)csh where `echo stash@{0}' does not print "stash@{0}".




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 04:42:01 GMT) Full text and rfc822 format available.

Message #32 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 9480 <at> debbugs.gnu.org, kjambunathan <at> gmail.com
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 00:37:22 -0400
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: Jambunathan K <kjambunathan <at> gmail.com>,  9480 <at> debbugs.gnu.org
> Date: Tue, 13 Sep 2011 00:03:10 -0400
> 
> Eli Zaretskii wrote:
> 
> > Perhaps someone who uses this on Unix or GNU system could try this
> > command and see if it needs quoting in general, not just on Windows
> > with Cygwin Bash.
> 
> FWIW, I can only find (t)csh where `echo stash@{0}' does not print "stash@{0}".

I wasn't able to reproduce it with Bash on a GNU system, either, but I
thought I was missing something.  Neither do I see any special
handling of the braces in the w32-specific parts of Emacs.

So it's a mystery why this happens with the Cygwin Bash.  Jambunathan,
could you perhaps post a question to the Cygwin mailing list?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 04:52:02 GMT) Full text and rfc822 format available.

Message #35 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9480 <at> debbugs.gnu.org, Antoine Levitt <antoine.levitt <at> gmail.com>
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 10:16:48 +0530
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Antoine Levitt <antoine.levitt <at> gmail.com>
>> Date: Mon, 12 Sep 2011 13:50:56 +0200
>> 
>> 12/09/11 13:22, Jambunathan K
>> >> Yes, I see the problem, but now I wonder how come users of Posix
>> >> platforms didn't see it.  Does it happen if your shell-file-name is
>> >> set to "sh", not "bash" (assuming the Cygwin Bash comes with such an
>> >> executable or a link)?
>> >
>> > sh and bash are apparently one and the same executable.
>> 
>> Bash runs in sh compatibility mode when invoked with "sh". From man bash:
>> 
>>        If bash is invoked with the name sh, it tries to mimic the
>>        startup behavior of historical versions of sh as closely as
>>        possible, while conforming to the POSIX standard as well.
>
> Right.  So results could be different, even though it's the same
> binary.  Jambunathan, please try that if you can.

The reported problem persists even if I run with emacs -Q and for ALL
THREE settings of shell-file-name

1. The default value - cmdproxy.exe
2. (setq shell-file-name "sh")
3. (setq shell-file-name "bash")

*vc-dir* correctly reports modified files in my work area correctly for
 ALL the above settings.

side note: My "shell quoting" changes produces the expected behaviour in
case of 2 and 3. But fails for scenario 1.

ps: I see that my remark about sh.exe and bash.exe being same has
produced some confusion. What I meant was sh.exe and bash.exe are
DIFFERENT EXECUTABLE FILES (in physical sense) but with the SAME
CONTENT.

,----
| $ ls -al *sh.exe
| -rwxr-xr-x 2 kjambunathan root  82446 2010-06-30 04:18 ash.exe
| -rwxr-xr-x 1 kjambunathan root 470542 2010-08-13 22:28 bash.exe
| -rwxr-xr-x 2 kjambunathan root  82446 2010-06-30 04:18 dash.exe
| -rwxr-xr-x 1 kjambunathan root   8718 2010-02-11 13:25 ppmflash.exe
| -rwxr-xr-x 1 kjambunathan root 470542 2010-08-13 22:28 sh.exe
| -rwxr-xr-x 1 kjambunathan root 342030 2010-09-03 14:14 ssh.exe
| lrwxrwxrwx 1 kjambunathan root     11 2011-03-16 14:31 tclsh.exe -> tclsh84.exe
| lrwxrwxrwx 1 kjambunathan root     10 2011-03-16 14:31 wish.exe -> wish84.exe
`----




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 05:19:01 GMT) Full text and rfc822 format available.

Message #38 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 9480 <at> debbugs.gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 10:44:02 +0530
> I wasn't able to reproduce it with Bash on a GNU system, either, but I
> thought I was missing something.  Neither do I see any special
> handling of the braces in the w32-specific parts of Emacs.

> So it's a mystery why this happens with the Cygwin Bash.  Jambunathan,
> could you perhaps post a question to the Cygwin mailing list?

If I open my regular Cygwin/XTerm [1] and type the command as you see
below (What you see is what I have typed) it reports the stash
correctly.

,---- From regular Cygwin/Xterm 
| $ git stash show -p stash@{0}
| diff --git a/Makefile b/Makefile
| index ce419c1..7183545 100644
| --- a/Makefile
| +++ b/Makefile
`----

It does seem like Emacs is messing up before handing over things.

That said, let me do some more debugging before I follow it up with
Cygwin folks.

Footnotes: 
[1]  This is launched like this:
C:\cygwin\bin\run.exe -p /usr/X11R6/bin xterm -fg green  -bg black  -sb
-sl 1000 -geom  80x15   -display 127.0.0.1:0.0 -ls






Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 06:22:02 GMT) Full text and rfc822 format available.

Message #41 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 9480 <at> debbugs.gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 11:47:00 +0530

> So it's a mystery why this happens with the Cygwin Bash.  Jambunathan,
> could you perhaps post a question to the Cygwin mailing list?

(setenv "CYGWIN" "noglob") 

solves the reported problem.

I was led to try the above option based on the below post which is
fairly recent: http://sourceware.org/ml/cygwin/2011-07/msg00218.html

Now I leave the table to the experts.

Jambunathan K.









Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 06:59:02 GMT) Full text and rfc822 format available.

Message #44 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: rgm <at> gnu.org, 9480 <at> debbugs.gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 02:54:07 -0400
> From: Jambunathan K <kjambunathan <at> gmail.com>
> Cc: Glenn Morris <rgm <at> gnu.org>,  9480 <at> debbugs.gnu.org
> Date: Tue, 13 Sep 2011 11:47:00 +0530
> 
> > So it's a mystery why this happens with the Cygwin Bash.  Jambunathan,
> > could you perhaps post a question to the Cygwin mailing list?
> 
> (setenv "CYGWIN" "noglob") 
> 
> solves the reported problem.
> 
> I was led to try the above option based on the below post which is
> fairly recent: http://sourceware.org/ml/cygwin/2011-07/msg00218.html

Thanks.  This unlocks the mystery.  I think we can now close the bug
report, do you agree?  Perhaps etc/PROBLEMS should advise Cygwin users
to set CYGWIN=noglob (as I understand the default is CYGWIN=glob).

I still don't understand why GLOB_BRACE causes "{0}" be expanded --
that sounds like a bug in the implementation of `glob' used by Cygwin,
no?  Perhaps a Cygwin bug report is in order.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 13:40:02 GMT) Full text and rfc822 format available.

Message #47 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 9480 <at> debbugs.gnu.org
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 09:35:11 -0400
> My shell-file-name is set to "bash" (cygwin version). My Emacs is

AFAIK this code does not run any shell.  Can you try to run those
commands by hand to see what kind of quoting (single quoting or double
quoting) is needed in a bash shell?


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 15:35:01 GMT) Full text and rfc822 format available.

Message #50 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9480 <at> debbugs.gnu.org, kjambunathan <at> gmail.com
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 18:27:17 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Tue, 13 Sep 2011 09:35:11 -0400
> Cc: 9480 <at> debbugs.gnu.org
> 
> > My shell-file-name is set to "bash" (cygwin version). My Emacs is
> 
> AFAIK this code does not run any shell.

Yes, and that's the problem: by default Cygwin apps glob their
command-line arguments when invoked from a non-Cygwin program,
assuming that those non-Cygwin programs expect them to.

This should generally work fine, except that IMO globbing in this case
is simply buggy: the braces are removed although a real shell would
expand "{0}" into itself.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 18:11:02 GMT) Full text and rfc822 format available.

Message #53 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9480 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 14:05:41 -0400
> Thanks.  This unlocks the mystery.  I think we can now close the bug
> report, do you agree?  Perhaps etc/PROBLEMS should advise Cygwin users
> to set CYGWIN=noglob (as I understand the default is CYGWIN=glob).

Yes, it seems that cygwin's globbing is never desired for programs run
by Emacs.  But of course, Emacs may start non-cygwin programs which in
turn execute cygwin programs expecting them to do the globbing
(e.g. running cygwin programs from a CMD process in *shell*), so setting
CYGWIN=noglob might not be right either.



        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Tue, 13 Sep 2011 18:26:01 GMT) Full text and rfc822 format available.

Message #56 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9480 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
	kjambunathan <at> gmail.com
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Tue, 13 Sep 2011 14:21:10 -0400
Eli Zaretskii wrote:

> This should generally work fine, except that IMO globbing in this case
> is simply buggy: the braces are removed although a real shell would
> expand "{0}" into itself.

I agree.

http://www.gnu.org/s/bash/manual/bash.html#Brace-Expansion

  A correctly-formed brace expansion must contain unquoted opening and
  closing braces, and at least one unquoted comma or a valid sequence
  expression. Any incorrectly formed brace expansion is left unchanged.

http://tiswww.case.edu/php/chet/bash/FAQ

Bash FAQ D2:

D2) Why doesn't bash treat brace expansions exactly like csh?

    The only difference between bash and csh brace expansion is that
    bash requires a brace expression to contain at least one unquoted
    comma if it is to be expanded.  Any brace-surrounded word not
    containing an unquoted comma is left unchanged by the brace
    expansion code.  This affords the greatest degree of sh
    compatibility.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9480; Package emacs. (Wed, 14 Sep 2011 11:04:02 GMT) Full text and rfc822 format available.

Message #59 received at 9480 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 9480 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Wed, 14 Sep 2011 16:28:27 +0530
Glenn Morris <rgm <at> gnu.org> writes:

> Eli Zaretskii wrote:
>
>> This should generally work fine, except that IMO globbing in this case
>> is simply buggy: the braces are removed although a real shell would
>> expand "{0}" into itself.
>
> I agree.

Glenn
Thanks for the reference note. I will file a bug report with Cygwin very
soon.

Eli
Feel free to close this bug.

> http://www.gnu.org/s/bash/manual/bash.html#Brace-Expansion
>
>   A correctly-formed brace expansion must contain unquoted opening and
>   closing braces, and at least one unquoted comma or a valid sequence
>   expression. Any incorrectly formed brace expansion is left unchanged.
>
> http://tiswww.case.edu/php/chet/bash/FAQ
>
> Bash FAQ D2:
>
> D2) Why doesn't bash treat brace expansions exactly like csh?
>
>     The only difference between bash and csh brace expansion is that
>     bash requires a brace expression to contain at least one unquoted
>     comma if it is to be expanded.  Any brace-surrounded word not
>     containing an unquoted comma is left unchanged by the brace
>     expansion code.  This affords the greatest degree of sh
>     compatibility.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 14 Sep 2011 12:03:01 GMT) Full text and rfc822 format available.

Notification sent to Jambunathan K <kjambunathan <at> gmail.com>:
bug acknowledged by developer. (Wed, 14 Sep 2011 12:03:01 GMT) Full text and rfc822 format available.

Message #64 received at 9480-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: rgm <at> gnu.org, 9480-done <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
Date: Wed, 14 Sep 2011 07:57:40 -0400
> From: Jambunathan K <kjambunathan <at> gmail.com>
> Cc:  Stefan Monnier <monnier <at> iro.umontreal.ca>,  9480 <at> debbugs.gnu.org
> Date: Wed, 14 Sep 2011 16:28:27 +0530
> 
> Glenn Morris <rgm <at> gnu.org> writes:
> 
> > Eli Zaretskii wrote:
> >
> >> This should generally work fine, except that IMO globbing in this case
> >> is simply buggy: the braces are removed although a real shell would
> >> expand "{0}" into itself.
> >
> > I agree.
> 
> Glenn
> Thanks for the reference note. I will file a bug report with Cygwin very
> soon.
> 
> Eli
> Feel free to close this bug.

Done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Oct 2011 11:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Stefan Monnier <monnier <at> IRO.UMontreal.CA> to control <at> debbugs.gnu.org. (Tue, 18 Oct 2011 19:16:02 GMT) Full text and rfc822 format available.

Forcibly Merged 9480 9784. Request was from Stefan Monnier <monnier <at> IRO.UMontreal.CA> to control <at> debbugs.gnu.org. (Tue, 18 Oct 2011 19:16:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 16 Nov 2011 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.