Subject: bug#9480: closed (Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 14 Sep 2011 12:03:01 +0000

Your bug report

#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
9480: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9480
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#9480: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
From: Eli Zaretskii <[email-masked]>
To: Jambunathan K <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Wed, 14 Sep 2011 07:57:40 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Jambunathan K <[email-masked]>
> Cc:  Stefan Monnier <[email-masked]>,  [email-masked]
> Date: Wed, 14 Sep 2011 16:28:27 +0530
> 
> Glenn Morris <[email-masked]> 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.

Subject: 24.0.50; (vc-git) stash@{n} - requires shell quoting?
From: Jambunathan K <[email-masked]>
To: [email-masked]
Date: Mon, 12 Sep 2011 12:39:43 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

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     : [email-masked]: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))
`----

*** a/vc-git.el	Mon Sep 12 12:14:06 2011
--- b/vc-git.el	Mon Sep 12 12:16:41 2011
***************
*** 1066,1085 ****
    (interactive)
    (let ((stash (vc-git-stash-get-at-point (point))))
      (when (y-or-n-p (format "Remove stash %s ? " stash))
!       (vc-git--run-command-string nil "stash" "drop" (format "stash@%s" stash))
        (vc-dir-refresh))))
  
  (defun vc-git-stash-show-at-point ()
    (interactive)
!   (vc-git-stash-show (format "stash@%s" (vc-git-stash-get-at-point (point)))))
  
  (defun vc-git-stash-apply-at-point ()
    (interactive)
!   (vc-git-stash-apply (format "stash@%s" (vc-git-stash-get-at-point (point)))))
  
  (defun vc-git-stash-pop-at-point ()
    (interactive)
!   (vc-git-stash-pop (format "stash@%s" (vc-git-stash-get-at-point (point)))))
  
  (defun vc-git-stash-menu (e)
    (interactive "e")
--- 1066,1093 ----
    (interactive)
    (let ((stash (vc-git-stash-get-at-point (point))))
      (when (y-or-n-p (format "Remove stash %s ? " stash))
!       (vc-git--run-command-string nil "stash" "drop"
! 				  (shell-quote-argument
! 				   (format "stash@%s" stash)))
        (vc-dir-refresh))))
  
  (defun vc-git-stash-show-at-point ()
    (interactive)
!   (vc-git-stash-show
!    (shell-quote-argument
!     (format "stash@%s" (vc-git-stash-get-at-point (point))))))
  
  (defun vc-git-stash-apply-at-point ()
    (interactive)
!   (vc-git-stash-apply
!    (shell-quote-argument
!     (format "stash@%s" (vc-git-stash-get-at-point (point))))))
  
  (defun vc-git-stash-pop-at-point ()
    (interactive)
!   (vc-git-stash-pop
!    (shell-quote-argument
!     (format "stash@%s" (vc-git-stash-get-at-point (point))))))
  
  (defun vc-git-stash-menu (e)
    (interactive "e")