From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Wolfgang Scherer Newsgroups: gmane.emacs.bugs Subject: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards Date: Thu, 6 Feb 2020 14:59:26 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------27A05B47FDAE0E731A585AE8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="87877"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 To: 39452@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 06 15:00:56 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1izhiB-000MfO-G9 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Feb 2020 15:00:55 +0100 Original-Received: from localhost ([::1]:39532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izhiA-0000T0-6t for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Feb 2020 09:00:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41570) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izhhQ-0000SS-7B for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2020 09:00:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izhhL-0003dB-5C for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2020 09:00:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41175) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1izhhL-0003bg-0X for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2020 09:00:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1izhhK-0000XT-U6 for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2020 09:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Wolfgang Scherer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Feb 2020 14:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39452 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: Emacs Bugs Original-Received: via spool by submit@debbugs.gnu.org id=B.15809975762005 (code B ref -1); Thu, 06 Feb 2020 14:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Feb 2020 13:59:36 +0000 Original-Received: from localhost ([127.0.0.1]:47148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izhgu-0000WH-9U for submit@debbugs.gnu.org; Thu, 06 Feb 2020 08:59:36 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1izhgs-0000W8-BA for submit@debbugs.gnu.org; Thu, 06 Feb 2020 08:59:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41056) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izhgr-0008UH-1q for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2020 08:59:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izhgp-0000uT-VL for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2020 08:59:32 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:36809) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1izhgp-0000jL-HL for bug-gnu-emacs@gnu.org; Thu, 06 Feb 2020 08:59:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1580997567; bh=TUC9q7vK15q64H+hCo7g0QKVkOT42e6o/Cf0Y7Y5B38=; h=X-UI-Sender-Class:To:From:Subject:Date; b=MfSNyvHIo7W6EYoS8XYBqOYyh9WD8jj4ulCASTrjmEIPI7GZN/wtBgyJJW/aPjk6S topNEJkcJTb84cZufZ0NApd0Wu5Uebsvk8Kbksz0t/sp2Orss5YeuYTiftRuCliLKJ 3vg2RVS5Cd0BTeEW7aP7DYX4vonQtGGYI1ueq9oo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from sheckley.simul.de ([87.160.210.52]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MEUzA-1ikrQq3lu6-00G0w2 for ; Thu, 06 Feb 2020 14:59:26 +0100 Original-Received: from [127.0.0.1] (sheckley.simul.de [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sheckley.simul.de (Postfix) with ESMTPSA id 7565519431C9 for ; Thu, 6 Feb 2020 14:59:26 +0100 (CET) Openpgp: preference=signencrypt Autocrypt: addr=Wolfgang.Scherer@gmx.de; prefer-encrypt=mutual; keydata= xsDiBEb46IgRBACMHOAb1KNo1Ylk+ebri+4R+bG4tyKlqBlrpv8D9/ZwRdXSGt+0DyCHoaAd 7KW7noHapLe87DunABOjKG4nqTGv+dRiWuUBlp3I4aYRFDVa3Da+XnIYkMHKqhK59VEHQCdp Km42nuLS7TS+n99at9YwzTG6VBdOlBKTlRFngOjVLwCg1RGXJ6X3EjS1FKCQeXziURVpWlkD /2zY6Ayhxi62TS84VjikXrrmjXykAAaAm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O7d1+bg/xEYFUc3iwd f4unMC+NUPk/QYlHKYK3aTvviGSMTLUnsIhs+UrSswCIuM2BPld/leUKV1N3sung7NhhTP/LD GF0rLYjTpvXIzoA6SxTnV0f8RuDBMS40RBwKOKV88oWWUDtDdYDUd/TtZNqCTucUsff6rXl1m R6H8o9UF6L25M098gvridiWCIr56TAo5TrK7fqmt9SHm6dKcBS6rUs8lQIR+ZWbVrZ86nmbIX rlwQjRd0ojW+cfF8qyls9g4w4odCWsfLY2oZCHqpdcxBjaVLwiiC9EduvDUunAJAcW2DZhvrY qI78MXmS4OeKfkYkkFlW5QnV/WzjYNLPLfc+X1wx97ftRKek8B0WFxLfEahP/du4Gvd8es9fv oRjpSH7+bkvNwySpQuXskUz+o68omn52Fv/QLkPbjLzbpPavggcTJK/U/dJjgFj92K7y/tlmL jXJ/rYoqMEkgPYSMvJVt+gRUOKiLFwmeCHzaHiasiUvHXh6JP4/a9Z2Bu6jMHMMFb1SkKPfT7 96LoPvWZy8FQvQqyznl2afxrpihrRTpSxteYSjrVqJDuh5r6KqZ6eI/eZRpZP+XpAgzX6mQx X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175725 Archived-At: This is a multi-part message in MIME format. --------------27A05B47FDAE0E731A585AE8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable When a filename contains shell wildcard characters matching one or more fi= les, e.g. `test[56].xx` matching both `test5.xx` and `test6.xx`: =C2=A0 -rw-r--r--=C2=A0 1 ws ws=C2=A0=C2=A0=C2=A0 0 Feb=C2=A0 6 08:51 test= [56].xx =C2=A0 -rw-r--r--=C2=A0 1 ws ws=C2=A0=C2=A0=C2=A0 0 Feb=C2=A0 6 08:51 test= 5.xx =C2=A0 -rw-r--r--=C2=A0 1 ws ws=C2=A0=C2=A0=C2=A0 0 Feb=C2=A0 6 08:51 test= 6.xx The command `vc-git-state` does not work correctly. The attched patch fixes this: diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 2caa287..0314e5e 100644 =2D-- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -330,7 +330,7 @@ in the order given by `git status'." =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,= @(when (version<=3D "1.7.6.3" (vc-git--program-version)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 '("--ignored")) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "= --")) -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (status (apply #'vc-git--run-c= ommand-string file args))) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (status (apply #'vc-git--run-c= ommand-string (shell-quote-argument file) args))) =C2=A0=C2=A0=C2=A0=C2=A0 (if (null status) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; If status is nil, ther= e was an error calling git, likely because =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; the file is not in a g= it repo. --------------27A05B47FDAE0E731A585AE8 Content-Type: text/x-patch; name="0001-vc-git-state-fails-for-filenames-with-wildcards.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-vc-git-state-fails-for-filenames-with-wildcards.patch" =46rom d123319e15d5ff24d3353f0d5c1b5f46c22172e2 Mon Sep 17 00:00:00 2001 From: Wolfgang Scherer Date: Thu, 6 Feb 2020 14:41:12 +0100 Subject: [PATCH] vc-git-state fails for filenames with wildcards * lisp/vc/vc-git.el (vc-git-state): file argument must be quoted to avoid wildcard expansion by shell. =2D-- lisp/vc/vc-git.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 2caa287..0314e5e 100644 =2D-- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -330,7 +330,7 @@ in the order given by `git status'." ,@(when (version<=3D "1.7.6.3" (vc-git--program-version)) '("--ignored")) "--")) - (status (apply #'vc-git--run-command-string file args))) + (status (apply #'vc-git--run-command-string (shell-quote-argument= file) args))) (if (null status) ;; If status is nil, there was an error calling git, likely becau= se ;; the file is not in a git repo. =2D- 2.7.4 --------------27A05B47FDAE0E731A585AE8--