all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Robert Pluim <rpluim@gmail.com>
Cc: 29303@debbugs.gnu.org, gus@inodes.org
Subject: bug#29303: 25.2; vc-git-grep should shell-escape FILES
Date: Wed, 15 Nov 2017 21:58:49 +0200	[thread overview]
Message-ID: <837eurjoue.fsf@gnu.org> (raw)
In-Reply-To: <87375fpehr.fsf@gmail.com> (message from Robert Pluim on Wed, 15 Nov 2017 19:45:52 +0100)

> From: Robert Pluim <rpluim@gmail.com>
> Cc: 29303@debbugs.gnu.org,  gus@inodes.org
> Date: Wed, 15 Nov 2017 19:45:52 +0100
> 
> > This cannot be right, because this style of quoting only works with
> > Posix shells.
> 
> There are people who run Emacs on Windows who use cmd.exe as the shell
> to invoke git?

Yes, most of them, because that's the default.  But that's not
relevant, because shell wildcards are expanded on Windows by the
startup code of the invoked program, not by the shell.

> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
> index ed85603f82..43164b4fcf 100644
> --- a/lisp/vc/vc-git.el
> +++ b/lisp/vc/vc-git.el
> @@ -1428,7 +1428,7 @@ vc-git-grep
>  				   nil nil 'grep-history)
>  	     nil))
>        (t (let* ((regexp (grep-read-regexp))
> -		(files (grep-read-files regexp))
> +		(files (mapconcat #'shell-quote-argument (split-string (grep-read-files regexp)) " "))
>  		(dir (read-directory-name "In directory: "
>  					  nil default-directory t)))
>  	   (list regexp files dir))))))

That's okay portability-wise, but why do you need split-string?
AFAIU, grep-read-files reads a single pattern, no?





  reply	other threads:[~2017-11-15 19:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15  6:25 bug#29303: 25.2; vc-git-grep should shell-escape FILES Angus Lees
2017-11-15  9:58 ` Robert Pluim
2017-11-15 17:42   ` Eli Zaretskii
2017-11-15 18:45     ` Robert Pluim
2017-11-15 19:58       ` Eli Zaretskii [this message]
2017-11-15 20:17         ` Robert Pluim
2017-11-15 20:26           ` Eli Zaretskii
2017-11-15 20:36             ` Robert Pluim
2017-11-16 15:38               ` Eli Zaretskii
2017-11-16 15:43                 ` Robert Pluim
2017-11-17  7:13                   ` Angus Lees
2017-11-17  8:38                 ` Robert Pluim
2017-11-17  9:06                   ` Eli Zaretskii
2017-11-17  9:54                     ` Robert Pluim
2017-11-17 10:13                       ` Eli Zaretskii
2017-11-17 10:33                         ` Robert Pluim
2017-11-17 13:41                           ` Eli Zaretskii
2017-11-17 14:21                             ` Robert Pluim
2017-11-28 13:37                               ` Robert Pluim
2017-11-28 17:49                                 ` Eli Zaretskii
2017-11-16 15:55         ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837eurjoue.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=29303@debbugs.gnu.org \
    --cc=gus@inodes.org \
    --cc=rpluim@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.