Am 07.02.20 um 18:25 schrieb Wolfgang Scherer: > Hi Dmitry, > > Am 07.02.20 um 00:00 schrieb Dmitry Gutov: >> On 06.02.2020 16:59, Wolfgang Scherer wrote: >>> When a filename contains shell wildcard characters matching one or more files, e.g. `test[56].xx` matching both `test5.xx` and `test6.xx`: >>> The command `vc-git-state` does not work correctly. >>> >>> The attched patch fixes this: >>> >>> -        (status (apply #'vc-git--run-command-string file args))) >>> +        (status (apply #'vc-git--run-command-string (shell-quote-argument file) args))) >>> >> Thanks for the report and the patch. >> >> I wonder how many other backends commands are broken for files like that: we basically never shell-quote file names. After some research, it seems that adding a pathspec magic to commands that support this feature is the best solution. Here is a patch that applies vc-git--literal-pathspec, vc-git--literal-pathspecs to some git commands in vc-git.el. I have tested all augmented commands in the shell and some in emacs. (defun vc-git--literal-pathspec-inner (pathspec)   "Prepend :(literal) path magic to PATHSPEC."   (concat ":(literal)" pathspec)) (defun vc-git--literal-pathspec (pathspec)   "Prepend :(literal) path magic to PATHSPEC."   (and pathspec (vc-git--literal-pathspec-inner pathspec))) (defun vc-git--literal-pathspecs (pathspecs)   "Prepend :(literal) path magic to PATHSPECS."   (mapcar #'vc-git--literal-pathspec-inner pathspecs))