GNU bug report logs - #39452
[PATCH] vc-git-state fails for filenames with wildcards

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>; Keywords: patch; dated Thu, 6 Feb 2020 14:00:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 14 Feb 2020 20:37:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 14 15:37:53 2020
Received: from localhost ([127.0.0.1]:34763 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j2hii-0003yo-Rz
	for submit <at> debbugs.gnu.org; Fri, 14 Feb 2020 15:37:53 -0500
Received: from mail-wr1-f66.google.com ([209.85.221.66]:42869)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1j2hih-0003yc-0b
 for 39452 <at> debbugs.gnu.org; Fri, 14 Feb 2020 15:37:51 -0500
Received: by mail-wr1-f66.google.com with SMTP id k11so12421106wrd.9
 for <39452 <at> debbugs.gnu.org>; Fri, 14 Feb 2020 12:37:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=BjIsyr41W9HE4xa0xh8OEWFHroxG2NKytfftAp5cq7c=;
 b=vEeTX4XZsjq+bNTkOBKnOU0m3ebswetwYH5V24V5NcZsp2BNS9z6KbJwJn2ew6JGbz
 uy1aGKfWJ8kqy2mt7280YQmhuAe+cYtW2wjGKIc+vMyICwVXEIH2biyOaPrKHm5uSfLi
 +hAbd3KGlnmq+3hW1DSmVQ5JltEPT8EvWr7a7UZ40hPjBnnPaXroX/sk9fUjX5Q9Zos/
 nIwzKP8lSIbQxkRmo7uh31md0kTiiJ4Hc5Gty3IfpOknvzARSUEjS+qRvh16ofBL0Edf
 mgZbI1VPhWB2pZf+MudpC6obe2QWWYaa833Z0b+iLGnsZwPpgsTU7JM6rTCKWBeBRUcR
 Fudg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=BjIsyr41W9HE4xa0xh8OEWFHroxG2NKytfftAp5cq7c=;
 b=ViaWo199PpcOayCniC9h7WMKdthjg8r6pGbVAUZCgm31dF9Y6rETIWoFBP/VC1fHxS
 05iO43U0yZByx/0TKVKYM3Wj1V9PIgC7qPKdJiL3SxH/elHZVqctNMVvmm0+sVAR04Or
 HQZ7B5Jx7cr1GqQq6YkaRaAto30J3Z4j2A/bj8+Yu2oylf6U2skged/Tl90++d1uLhSY
 LByv+/7HMZCVljos7s8+UAN4w+090B38MIzLuMe/g8TArpv4mHOvD1r4DPlIy8TzG6bp
 haFvFMOj50FP0aBur0iZwANMiH3iS1FU5/Y45CBeu3JME1c3ZwR9eUx9b9ZK/x5xnxnA
 akeA==
X-Gm-Message-State: APjAAAWpjn4AIGUfx+9Sy+8IW/9DzhyKlPwTydbWOyiIyLs7f5Iv6qGv
 syhLzcxzEtYEoAvE+dwkzSQ=
X-Google-Smtp-Source: APXvYqzHHwBHjxTVVuGH8rKyEgYu67X0LaBxfZwtDLDFbQyOlh7JU6UnbZf1DtT4QA4dLP816CF3DQ==
X-Received: by 2002:adf:dd46:: with SMTP id u6mr5546367wrm.13.1581712664985;
 Fri, 14 Feb 2020 12:37:44 -0800 (PST)
Received: from [192.168.0.3] ([66.205.73.129])
 by smtp.googlemail.com with ESMTPSA id a13sm8520673wrp.93.2020.02.14.12.37.43
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 14 Feb 2020 12:37:44 -0800 (PST)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Eli Zaretskii <eliz@HIDDEN>
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <85y2texxso.fsf@HIDDEN>
 <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
 <d8505875-bba8-ac47-ab8d-dfa5626307be@HIDDEN>
 <b169a439-eb66-349b-87ea-3d37a83d2d5b@HIDDEN> <83d0ahpkzu.fsf@HIDDEN>
 <6f06f4c8-17c0-31a7-a6d8-e40686b1e987@HIDDEN> <83y2t5ntm6.fsf@HIDDEN>
 <360947a9-3828-a97d-1ddf-6990344e8f77@HIDDEN> <83wo8pnpe3.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <a7116ef3-fe44-5b94-25cc-e1ffb7f70b22@HIDDEN>
Date: Fri, 14 Feb 2020 22:37:42 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <83wo8pnpe3.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 39452
Cc: npostavs@HIDDEN, 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 14.02.2020 17:45, Eli Zaretskii wrote:
> I won't argue.  I just wanted to point out that using Git signatures
> internally might get in the way, whereas environment variables and
> command-line switches are free from that disadvantage.

Um, I think they're about the same in the level of convenience for us to 
be able to disable either: we can add a global var which would affect 
whether specs are interpreted literally.

If anything, approach #1 is slightly easier if we wanted to support 
opting out of literal-quoting the specs at the level of VC backend 
actions: certain action implementations can simply avoid calling the 
proposed functions (like vc-git--literal-pathspec). But then, I'm not 
sure that we want this capability at exactly that abstraction level.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 14 Feb 2020 15:46:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 14 10:46:01 2020
Received: from localhost ([127.0.0.1]:34482 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j2dAG-00037R-Ny
	for submit <at> debbugs.gnu.org; Fri, 14 Feb 2020 10:46:00 -0500
Received: from eggs.gnu.org ([209.51.188.92]:37133)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1j2dAD-000378-W8
 for 39452 <at> debbugs.gnu.org; Fri, 14 Feb 2020 10:45:58 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:34250)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1j2dA8-0004wo-6q; Fri, 14 Feb 2020 10:45:52 -0500
Received: from [176.228.60.248] (port=3578 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1j2dA7-0001zg-GR; Fri, 14 Feb 2020 10:45:51 -0500
Date: Fri, 14 Feb 2020 17:45:56 +0200
Message-Id: <83wo8pnpe3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <360947a9-3828-a97d-1ddf-6990344e8f77@HIDDEN> (message from
 Dmitry Gutov on Fri, 14 Feb 2020 16:40:04 +0200)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <85y2texxso.fsf@HIDDEN>
 <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
 <d8505875-bba8-ac47-ab8d-dfa5626307be@HIDDEN>
 <b169a439-eb66-349b-87ea-3d37a83d2d5b@HIDDEN> <83d0ahpkzu.fsf@HIDDEN>
 <6f06f4c8-17c0-31a7-a6d8-e40686b1e987@HIDDEN> <83y2t5ntm6.fsf@HIDDEN>
 <360947a9-3828-a97d-1ddf-6990344e8f77@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 39452
Cc: npostavs@HIDDEN, 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> Cc: npostavs@HIDDEN, 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Fri, 14 Feb 2020 16:40:04 +0200
> 
> On 14.02.2020 16:14, Eli Zaretskii wrote:
> > Any command that prompts for a file name, I guess.  vc-delete-file and
> > vc-rename-file come to mind.
> 
> In both of these commands entering a non-trivial pathspec is both 
> undocumented and hard to do: look at the interactive form, it calls 
> read-file-name with MUSTMATCH t. In other words, it doesn't let you 
> input interactively anything that's not an existing file name.
> 
> > But my comment was more general: we don't plan on not supporting Git
> > specs in file names, do we?
> 
> I don't see how we'd keep supporting them in these two particular 
> commands without keeping bugs similar to this one unfixed (e.g. 'M-x 
> vc-delete-file test[56].xx' where test[56].xx is an existing filename).
> 
> AFAICS, they're working purely by accident. That's not to say we can't 
> introduce new versions of these commands that would accept pathspecs (or 
> do it with C-u, etc).

I won't argue.  I just wanted to point out that using Git signatures
internally might get in the way, whereas environment variables and
command-line switches are free from that disadvantage.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 14 Feb 2020 14:40:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 14 09:40:15 2020
Received: from localhost ([127.0.0.1]:32806 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j2c8d-00018f-82
	for submit <at> debbugs.gnu.org; Fri, 14 Feb 2020 09:40:15 -0500
Received: from mail-ed1-f67.google.com ([209.85.208.67]:40156)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1j2c8b-00018M-0e
 for 39452 <at> debbugs.gnu.org; Fri, 14 Feb 2020 09:40:13 -0500
Received: by mail-ed1-f67.google.com with SMTP id p3so11446748edx.7
 for <39452 <at> debbugs.gnu.org>; Fri, 14 Feb 2020 06:40:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=oxQpa2rXjFsduJLzNgNLJRPKYjOl3um3rU1kM1Kjj+8=;
 b=rMYSN/2UDC7TVZ99kQAdukXx8A8YmQ0whiTd8Ywja4qINqHNz2rYrX05JToa3ItolB
 IrUFTxfN+68mLXGRYYdu6Qry1r6hI3FA68aU00udi7fXBqK6rWQqNOljI8o7q8ylFsqP
 H7EmU2cwxV0Mmli9I6Y5Wmtov0mnFHwFoIZnBcDmT793dWS+FaGjAxKm5t8ginkUUSM8
 RBmrsJnoJ0on7dEDLcQfgOaablwQyQKwQDOh27k+VGJZWeib0czOVX7Ma/zhLlFhk3yd
 tc41J67Ap+bugXsiijdURhHPXEU96OZzBs1/wXdEmHlYBqGxI2UaKFU5UlVD7Jq+rHoH
 ewHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=oxQpa2rXjFsduJLzNgNLJRPKYjOl3um3rU1kM1Kjj+8=;
 b=VcApVVFAyzK0lMwkDNFdjCvdwfmnfiQHr2ZesejgdzVCIR3FIt92JH84+tbmkwbdfe
 CqsfXOUM77goKT4x31EbBCJVWqnJphzJMT7W898sAJgpPSZnvSslf4pWuxqzDJyoqgSR
 VPHAPWDfPqV+W80ZSm6ENjIYBKhsubLJbkG3ou15unnhKcBPoN6Rs3uoOTuZXRc6DUG7
 17funHOaZwpxDruJNsA8dZqXjDblq72gbwz0l3HF2SUky6fdxLAERcMuiPnA523Cg+M9
 8wqr5eBsV4peYNIX0M+NvsF+eGfRnDNz/K9uFB/xCGaemozOxtNPjwwWImTjOBczHUGh
 8Yyg==
X-Gm-Message-State: APjAAAUXafWSixK7jUmL/P9ZDo+59mbj3PgZoA75D3mmvAan2giFcfqI
 m7HEu1Yj//wTiUIrd8/W4XI=
X-Google-Smtp-Source: APXvYqwwe05auT21M/sY+Xh/TA5V7/HcKWd65FLpG233MVqGL0Htu59RrwiHcLA7Eiw+aRHi3ick0g==
X-Received: by 2002:aa7:da91:: with SMTP id q17mr3088721eds.308.1581691207124; 
 Fri, 14 Feb 2020 06:40:07 -0800 (PST)
Received: from [192.168.0.155] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id f7sm591453ejq.38.2020.02.14.06.40.05
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 14 Feb 2020 06:40:06 -0800 (PST)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Eli Zaretskii <eliz@HIDDEN>
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <85y2texxso.fsf@HIDDEN>
 <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
 <d8505875-bba8-ac47-ab8d-dfa5626307be@HIDDEN>
 <b169a439-eb66-349b-87ea-3d37a83d2d5b@HIDDEN> <83d0ahpkzu.fsf@HIDDEN>
 <6f06f4c8-17c0-31a7-a6d8-e40686b1e987@HIDDEN> <83y2t5ntm6.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <360947a9-3828-a97d-1ddf-6990344e8f77@HIDDEN>
Date: Fri, 14 Feb 2020 16:40:04 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <83y2t5ntm6.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 39452
Cc: npostavs@HIDDEN, 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 14.02.2020 16:14, Eli Zaretskii wrote:
> Any command that prompts for a file name, I guess.  vc-delete-file and
> vc-rename-file come to mind.

In both of these commands entering a non-trivial pathspec is both 
undocumented and hard to do: look at the interactive form, it calls 
read-file-name with MUSTMATCH t. In other words, it doesn't let you 
input interactively anything that's not an existing file name.

> But my comment was more general: we don't plan on not supporting Git
> specs in file names, do we?

I don't see how we'd keep supporting them in these two particular 
commands without keeping bugs similar to this one unfixed (e.g. 'M-x 
vc-delete-file test[56].xx' where test[56].xx is an existing filename).

AFAICS, they're working purely by accident. That's not to say we can't 
introduce new versions of these commands that would accept pathspecs (or 
do it with C-u, etc).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 14 Feb 2020 14:14:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 14 09:14:46 2020
Received: from localhost ([127.0.0.1]:32800 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j2bjx-0000Yk-HR
	for submit <at> debbugs.gnu.org; Fri, 14 Feb 2020 09:14:46 -0500
Received: from eggs.gnu.org ([209.51.188.92]:46745)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1j2bjw-0000YY-9b
 for 39452 <at> debbugs.gnu.org; Fri, 14 Feb 2020 09:14:44 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:33074)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1j2bjq-0004gu-Q3; Fri, 14 Feb 2020 09:14:38 -0500
Received: from [176.228.60.248] (port=1925 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1j2bjq-00039f-2u; Fri, 14 Feb 2020 09:14:38 -0500
Date: Fri, 14 Feb 2020 16:14:41 +0200
Message-Id: <83y2t5ntm6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <6f06f4c8-17c0-31a7-a6d8-e40686b1e987@HIDDEN> (message from
 Dmitry Gutov on Fri, 14 Feb 2020 15:59:41 +0200)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <85y2texxso.fsf@HIDDEN>
 <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
 <d8505875-bba8-ac47-ab8d-dfa5626307be@HIDDEN>
 <b169a439-eb66-349b-87ea-3d37a83d2d5b@HIDDEN> <83d0ahpkzu.fsf@HIDDEN>
 <6f06f4c8-17c0-31a7-a6d8-e40686b1e987@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 39452
Cc: npostavs@HIDDEN, 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> Cc: npostavs@HIDDEN, 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Fri, 14 Feb 2020 15:59:41 +0200
> 
> On 14.02.2020 11:37, Eli Zaretskii wrote:
> > I also tend towards the latter, especially since (AFAIU) we don't
> > prevent users from using the Git magic signatures in file-name specs
> > (where it makes sense), in which case we'd need some code to detect
> > and combine signatures.
> 
> Could you clarify? What commands and backend actions expect or 
> intentionally allow file-name specs instead of file-names verbatim?

Any command that prompts for a file name, I guess.  vc-delete-file and
vc-rename-file come to mind.

But my comment was more general: we don't plan on not supporting Git
specs in file names, do we?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 14 Feb 2020 13:59:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 14 08:59:52 2020
Received: from localhost ([127.0.0.1]:32781 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j2bVX-0000Bf-Uq
	for submit <at> debbugs.gnu.org; Fri, 14 Feb 2020 08:59:52 -0500
Received: from mail-ed1-f65.google.com ([209.85.208.65]:37221)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1j2bVV-0000BS-R5
 for 39452 <at> debbugs.gnu.org; Fri, 14 Feb 2020 08:59:50 -0500
Received: by mail-ed1-f65.google.com with SMTP id df17so4547744edb.4
 for <39452 <at> debbugs.gnu.org>; Fri, 14 Feb 2020 05:59:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=ruSy6j1mblwkP+6eqkiCuhXN1vAROGBxLB1dI0AZ674=;
 b=pJOvL5bk3rfsBjGj8zoZnp20OTSoaN8y6Pwu9lxCK0TKX6sLvieYJUBQd9BGgkCzFy
 Mey1/AWy6qJT/yNntKcamxIvfLPw6ayl+WhPh67NgjtnnEBxSrPzGrRztXYIF7LAzerN
 K4npeUSV5cMWjFEmAteZuwpbtHTHrwisCUbMnPayxdWCWqw+d9magnbmskzmJNLZ1AfF
 iQMmRzimMQcbKEhf266W6sJonkt4wL8UMT04Lr9peO3O87Zrt9p06KpQ9Sl8tPZ7ewkh
 8A4EmEirxDj53s76DmhD57gJEEJZCVizlAklH2mJAZNTyrEszVHbhoumZEQevRTSJzIQ
 3vWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=ruSy6j1mblwkP+6eqkiCuhXN1vAROGBxLB1dI0AZ674=;
 b=Ze5ZdenGYFT9Nf4f4kQOtQoJslaKvMDF+24A2D1odD80kmDrpuFXeIeqgzbUhEQYHX
 A3tgSehbstipwY3u6C67gRFV59ThVpND54JYcCGI++mngMWsFYnKdkOdAhTvAtZnC/D+
 5srJ1BHFgXBhhhhStAiYmQAp8IsFkbH6NDBfwhNZnCsCOeD5i09hM0Z+xOp0kOFtHbi/
 RrP7hWPbOqU9B4vlPpBQgBAphHb3wm9E6egJ30CfTU1XJ/VSx/3SAOVuEJIdFZbXtCc7
 WwSbNLM1ipUKS6x5I41dyePfg0kqvKJf6KvRqpcosnN55ac6uD6WrGZVSGTPYLROGIXr
 1Yvw==
X-Gm-Message-State: APjAAAXhfB1tyEIPu9RPRFoqiSMV4ASfZa7gt9wfKG5fgpAPC2//4Afx
 Zgz2McK6RnN7b0+GRupfggc=
X-Google-Smtp-Source: APXvYqx2t+nGmYI8H7Z6vB9rCAlBiVWKy7nHUdYeHCEjo3tuKLc2T6TkMnPVF8tampCvBuwsCVa5uw==
X-Received: by 2002:a17:906:f915:: with SMTP id
 lc21mr3101508ejb.360.1581688783853; 
 Fri, 14 Feb 2020 05:59:43 -0800 (PST)
Received: from [192.168.0.155] ([109.110.245.170])
 by smtp.googlemail.com with ESMTPSA id i21sm383639edj.33.2020.02.14.05.59.42
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 14 Feb 2020 05:59:43 -0800 (PST)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Eli Zaretskii <eliz@HIDDEN>
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <85y2texxso.fsf@HIDDEN>
 <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
 <d8505875-bba8-ac47-ab8d-dfa5626307be@HIDDEN>
 <b169a439-eb66-349b-87ea-3d37a83d2d5b@HIDDEN> <83d0ahpkzu.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <6f06f4c8-17c0-31a7-a6d8-e40686b1e987@HIDDEN>
Date: Fri, 14 Feb 2020 15:59:41 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <83d0ahpkzu.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 39452
Cc: npostavs@HIDDEN, 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 14.02.2020 11:37, Eli Zaretskii wrote:
> I also tend towards the latter, especially since (AFAIU) we don't
> prevent users from using the Git magic signatures in file-name specs
> (where it makes sense), in which case we'd need some code to detect
> and combine signatures.

Could you clarify? What commands and backend actions expect or 
intentionally allow file-name specs instead of file-names verbatim?

Aside from vc-ignore, I suppose. Which won't be affected either way.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 14 Feb 2020 09:38:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 14 04:38:02 2020
Received: from localhost ([127.0.0.1]:60865 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j2XQA-0000DP-GM
	for submit <at> debbugs.gnu.org; Fri, 14 Feb 2020 04:38:02 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36930)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1j2XQ8-0000Cw-QY
 for 39452 <at> debbugs.gnu.org; Fri, 14 Feb 2020 04:38:01 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45761)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1j2XQ3-0004wJ-5e; Fri, 14 Feb 2020 04:37:55 -0500
Received: from [176.228.60.248] (port=4782 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1j2XQ2-0004gG-Ed; Fri, 14 Feb 2020 04:37:54 -0500
Date: Fri, 14 Feb 2020 11:37:57 +0200
Message-Id: <83d0ahpkzu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <b169a439-eb66-349b-87ea-3d37a83d2d5b@HIDDEN> (message from
 Dmitry Gutov on Fri, 14 Feb 2020 01:23:50 +0200)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <85y2texxso.fsf@HIDDEN>
 <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
 <d8505875-bba8-ac47-ab8d-dfa5626307be@HIDDEN>
 <b169a439-eb66-349b-87ea-3d37a83d2d5b@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 39452
Cc: npostavs@HIDDEN, 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> Cc: 39452 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Fri, 14 Feb 2020 01:23:50 +0200
> 
> Eli, what do you think is better, applying a more verbose fix (which 
> prepends stuff to every file name) and spending some of our complexity 
> budged on that.
> 
> Or using the simple fix and documenting the git hooks erratum in the 
> manual (or somewhere else).
> 
> I'm inclining toward the latter, esp. considering that the problem 
> should be familiar to Magit users already, and thus the fix is 
> prominently documented on the Internet.

I also tend towards the latter, especially since (AFAIU) we don't
prevent users from using the Git magic signatures in file-name specs
(where it makes sense), in which case we'd need some code to detect
and combine signatures.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 13 Feb 2020 23:24:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 13 18:24:02 2020
Received: from localhost ([127.0.0.1]:60639 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j2Npy-0002G3-1R
	for submit <at> debbugs.gnu.org; Thu, 13 Feb 2020 18:24:02 -0500
Received: from mail-wm1-f67.google.com ([209.85.128.67]:37467)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1j2Npv-0002FZ-V0
 for 39452 <at> debbugs.gnu.org; Thu, 13 Feb 2020 18:24:00 -0500
Received: by mail-wm1-f67.google.com with SMTP id a6so8698053wme.2
 for <39452 <at> debbugs.gnu.org>; Thu, 13 Feb 2020 15:23:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=at+oB8MiIGYdXvrSqd7TUftXXDYE0x/ej6ieUzFcank=;
 b=Qkurzrqb4g4E0Wm6LOTMgOEDAXc2ax35AvxPm15eXuwmpzCNTlmaXXTVsV2f1UZ6Gp
 EU2s6k+AbNxkOC3HltwuoYLj5HtF5+PvTpHCzyuA2s1Z5FofORiqdXvv2UgwV54E0md3
 Qb0gclZV/J1SLIOi6HPICnhg2UOH0G03xPP46gdtag9kyA+8qT6LlzFFpMzWOv0XuxjY
 NN7RlQWZT+sj3yRo+/YdtXsnXdkTFkLq3sVXgKpXsnxoyNURJpuP2dAVqgNEOXAkVM/T
 bYZ6VrgBGxaD3tnaqHeWy9USwS/Xzk4oyyvzizxVOw0ZtLPQWC+GDfOSOOl9GA8SyIuZ
 kmWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=at+oB8MiIGYdXvrSqd7TUftXXDYE0x/ej6ieUzFcank=;
 b=s/ozRI1VYHoDANNKS9Yrd5DUBUg4m/2JLKytTXtsBwA9zDK2zC1bFQA5tnj+3yVJH9
 3rUc+VHAwfuEZXCwJtLU8gi3xjJVfrSdZUkPwirhbN+J2Djv3wFear+xYoV3j967ZbMj
 qcBV1Lcuqd0+eOlLHkeDoyI8jUTmg8SS/krCcDhYYE2Q8aT+dVNdPKFDbPIxO7qSp9gt
 nPUayCCbKXuQOAE3McmLi4GsLLNKomd9FC7WR1XIrqCoMvuCaZsGwpaFrmwnxue5DK0i
 jAYj4ENUn1xibRq87DsFOGCMl09Q35/SOSXYpoR0ptXH1Ul7+eIRPMgHIA91qjdrnyN2
 yrIQ==
X-Gm-Message-State: APjAAAX7V/lIS79bGKsvAQ0mDsMq+Az0RHyvwUDoZfvYRmn1g5eNpe7Y
 FfyHvYK6qGVXTgMfDxM0c5Vt1fqV
X-Google-Smtp-Source: APXvYqyzJu9ZAas+9iC9YU6FagIBfP2nBMPT9NCD69xESW+hspDJX9I1Z3361E08g+2rBBjz2dbGyQ==
X-Received: by 2002:a7b:cc6a:: with SMTP id n10mr422044wmj.170.1581636233104; 
 Thu, 13 Feb 2020 15:23:53 -0800 (PST)
Received: from [192.168.0.3] ([66.205.73.129])
 by smtp.googlemail.com with ESMTPSA id o15sm4804439wra.83.2020.02.13.15.23.51
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 13 Feb 2020 15:23:52 -0800 (PST)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>,
 Noam Postavsky <npostavs@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <85y2texxso.fsf@HIDDEN>
 <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
 <d8505875-bba8-ac47-ab8d-dfa5626307be@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <b169a439-eb66-349b-87ea-3d37a83d2d5b@HIDDEN>
Date: Fri, 14 Feb 2020 01:23:50 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <d8505875-bba8-ac47-ab8d-dfa5626307be@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 39452
Cc: 39452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 13.02.2020 20:34, Wolfgang Scherer wrote:

>> And if Magit does it, it's probably okay for most of VC users too.
> 
> It might be worth documenting in the manual, since the problem comes up quite a lot in issues and Stackoverflow.

You mean the problem inside git hooks, if such solution is applied?

Weird how I never seen it mentioned before.

Anyway, at this point I'd rather hear more opinion.

Eli, what do you think is better, applying a more verbose fix (which 
prepends stuff to every file name) and spending some of our complexity 
budged on that.

Or using the simple fix and documenting the git hooks erratum in the 
manual (or somewhere else).

I'm inclining toward the latter, esp. considering that the problem 
should be familiar to Magit users already, and thus the fix is 
prominently documented on the Internet.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 13 Feb 2020 18:34:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 13 13:34:52 2020
Received: from localhost ([127.0.0.1]:60433 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j2JK8-0006FW-7S
	for submit <at> debbugs.gnu.org; Thu, 13 Feb 2020 13:34:52 -0500
Received: from mout.gmx.net ([212.227.17.21]:58689)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1j2JK5-0006FG-Mk
 for 39452 <at> debbugs.gnu.org; Thu, 13 Feb 2020 13:34:50 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1581618883;
 bh=532uUh+OH7/n6/EC0YXlIgR9L6KiCdc2V7BvD5VIKHw=;
 h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To;
 b=RMg3UAy1ooHlsDgYa0hOo6CqOXQ+OTiwCewUt2j0Gg7jno2vVGC0cdmN/hAmgKxwP
 BQY+TEG1tX6upWj3oGQXzqqDB4wB6MCJLom3cMEaOK/K/x2GP8h55tTlyVAotKmNDk
 1HD7nKte+lrPbm165eaPVIskp++cHZZKYb4zxfhk=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from sheckley.simul.de ([87.160.210.52]) by mail.gmx.com (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MeU0q-1jaGYx0Agm-00aVMB; Thu, 13
 Feb 2020 19:34:43 +0100
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 5F7F219431D6;
 Thu, 13 Feb 2020 19:34:42 +0100 (CET)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Dmitry Gutov <dgutov@HIDDEN>, Noam Postavsky <npostavs@HIDDEN>
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <85y2texxso.fsf@HIDDEN>
 <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
From: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>
Openpgp: preference=signencrypt
Autocrypt: addr=Wolfgang.Scherer@HIDDEN; prefer-encrypt=mutual; keydata=
 xsDiBEb46IgRBACMHOAb1KNo1Ylk+ebri+4R+bG4tyKlqBlrpv8D9/ZwRdXSGt+0DyCHoaAd
 7KW7noHapLe87DunABOjKG4nqTGv+dRiWuUBlp3I4aYRFDVa3Da+XnIYkMHKqhK59VEHQCdp
 Km42nuLS7TS+n99at9YwzTG6VBdOlBKTlRFngOjVLwCg1RGXJ6X3EjS1FKCQeXziURVpWlkD
 /2zY6Ayhxi62TS84VjikXrrmjXykAAaAmMVEyKKYb9L5pGlqiZz9g/K9xw1EUoZTYuaufquD
 v4rAGR58K/3V4CYfJLEeshMWiaXHvMmlxMznlG16/um4MvmR8B3r+cx0nOPK1JBdD2qrkNnF
 Mw8FB+zouLFB4Gt2IUC5IlOmZ8OQA/4qdU53CItzWsCr9Nux4L0qUlRweSmCnV8xGQ2wP5XI
 MawIQxxREvSrsYDG8cNnYETMg4iQFfIktwAoxCJvuFAwIB6ZxHGF4FcEZm64CXc2u7CmFLqt
 rVhXhIfMz9oEYC+HhGczGamn9ofbGTFd2hJEtPcQgWNR4f7+aKknmi2+OM0fV29sZmdhbmcg
 U2NoZXJlciA8d3NAc3ctYW10LndzPsJhBBMRAgAhBQJYmz3YAhsjBQsJCAcCBhUICQoLAgQW
 AgMBAh4BAheAAAoJEIUCr3Gr112VZZoAoLTBSTp1qGuNhLdXY04iaWCMYmHCAJ4kHPtQ6nTw
 kEq9qCHgVgXDaY7wjs7ATQRG+OiIEAQAhi0wjcxvA4tychg2NQuwBIf9LX/46l+74+QbewCn
 a4a+mw/9s5KYqLGtYMuu3/KYq9yBd53OYc7LWTLMxsGOIATSOQRhdCKYW1AanupYrC/bKNW/
 8i2QEXc7LIeYiaII0TkVdQTVZxrg9kKLQ+Vf6z04Lbfv91sVCkHKI9jxgVMAAwUD/0mkDeN0
 tllPH+NOjbkkqlOj6UOwzwIYgXmALhuAEFGXVLM2HfRV9TtJa2OoGZiuhyGXat3Jl9QK9NNv
 d/J4HSal93ZHWstPU4YIRc5uhJ1eeWwKsfTmPvbZXMKMkh+hBBJ39SZnmxfoeUzkK0EQNE2p
 PZDyjAlz03qOx6D0DHnZwkkEGBECAAkFAkb46IgCGwwACgkQhQKvcavXXZU8PwCdGmUH5mbh
 dsLYyx7qthe4hOWnW54AoJQMfmHP4uUI6ji8VkdlvO8LKtLP
Message-ID: <d8505875-bba8-ac47-ab8d-dfa5626307be@HIDDEN>
Date: Thu, 13 Feb 2020 19:34:42 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.1
MIME-Version: 1.0
In-Reply-To: <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Content-Language: de-DE
X-Provags-ID: V03:K1:AQ+TvhaaPP3ZG7Emv2J0Fh9nJDLy/b3WQ3wX2iqcPX+WaywEy05
 r8Mg2/ityRdhVGLsbWinBlohTq6IBFfen6s/GIAuXu/hHgjsIU4en6eGiXuGRnqTCF9EStY
 NkYuHYOubCpAA0bHLy+Zr0kYDi8lLgywAmz9Pqr5Qqy9IKeLjjXkTYAsbiqDUCl+kaNPFtv
 zU5Ww5YMNQSORta0MofWg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:Iwo8l9vCqV8=:bn+yNhikrCSMEFTNcvQ1l8
 w9fOyE8py36PwxWRXCaWJgvg98GrQLcWTTNc45rw0su1oDiwpqEKGYOvSZhaekglZA9CogGgO
 iTJjF7hnAlBMVtXUiFZi9NQACZJXK4XS28MN29lX5DRTab6V6MLTg/R7GZGqX/7CDAQ+xviSD
 xVWjZwWrQKJZVA1Ss9lPWTgDDldM6vNwW2I767omyS9Bpw1zAHw5mgQp8msGPfHjz9GQDCwE3
 IhtIxfI3SXUUHcK9puLVg4Y4CvxkuN34ybrhbcpG2cYCqBLA7zEUOyVlqd6ihgcPvkEXcYHXs
 eaMcfAm5iGSwM50eqJiIf/poCf0PGumv2DPpaUcZ14gcur22UDfCRUq0ZWpwaZf/hpSYeatAJ
 oT0StNK2E57A31inTz5rdBQdq3WSxIVxMsfUhFCoMiHVLmR/3u+i85UbGENLw27m2o9VVLVvM
 6cC61jUUK4nhFvZ090TLHsRzem/8Lg7v5HIym42U755dXut8eC4rwO0YZDMQmdrpTOwGjayYc
 AKcxRALF0qRuQbJvLt9tEpOdGLaSOEbpZvvEu/CLVPW/MsTf16DBxAunm/JbS5LPCmn54dlag
 svdgsaX/LkeFT5INyK12HM/f9sScbLWp/b8qrVhQHPePNEnVk4XQEVhYrqfg6vvC49tLyn8QK
 MQ7xX+d9uTKU7imQ4sscyJafT6SzL1TIrCMjPQDsDEbyfLqI4knNWlqA/rd9S2WYO0O7BQKrl
 bpMmnlbQf/7dS6Hx3cXk2uqlZ94GGtlPEwCoiVEbJufeMPHFDEqBFBhOTkvSK3hcGqUMwSVhK
 qzI/J7SQ5AoEWkAQ4on9upSAauLpjBS7HOdQrqGl+wjIWQWmWs1bD3TM6AJG0OWIxXGapv6dq
 W60bNiokc8ZU9VTibOghlwqAm3bglGC/oAyyYPsu9YBnLnTHoJ69UTvjuzxOBdv8190I2wgjI
 A+98MA4lzc19TYPfFYPPkPy375Lz7+edzAs+gHzLDtp2RHm7ikgDHVbV9WaR7yDc6eicsurua
 /xrlaWM+5mLr+PtJWXoF12dtzpYW4TCuiT66I4FvwsyZtM3VAdeE2Z8o1+Jc4KQECjRusNJ6v
 mYUQ2Jhm6vEXj1Y2xSfiSLeIseUMysSvwtwA6a3aukHxB6nvulXHc0MwppuO+brLNDv2K+cQS
 7awQTjSYtvkPLNi3mW5gsYSqbpFC11tMINNIh7TtANb6yuVKGCPvBP0hdcfcJ4tfmBi4eyEdK
 JNrMhTFVuDfjNHrMF
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 39452
Cc: 39452 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


Am 12.02.20 um 00:01 schrieb Dmitry Gutov:
> The patch is much smaller than the proposed alternative:

The patch works as expected.

> And if Magit does it, it's probably okay for most of VC users too.

It might be worth documenting in the manual, since the problem comes up quite a lot in issues and Stackoverflow.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 12 Feb 2020 15:24:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 12 10:24:38 2020
Received: from localhost ([127.0.0.1]:58945 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j1tsT-00033F-O2
	for submit <at> debbugs.gnu.org; Wed, 12 Feb 2020 10:24:37 -0500
Received: from mail-qt1-f194.google.com ([209.85.160.194]:43562)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1j1tsQ-000332-RH
 for 39452 <at> debbugs.gnu.org; Wed, 12 Feb 2020 10:24:36 -0500
Received: by mail-qt1-f194.google.com with SMTP id d18so1828370qtj.10
 for <39452 <at> debbugs.gnu.org>; Wed, 12 Feb 2020 07:24:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=V6Tnypzqvz/Ga9wtW44Y9+fsDAdf+VkZknBDY9g6bM8=;
 b=UdxN3i4WkeRcIIgmBcNSrL4wkbnnUkW7JC+6ber/OaZKuKCUv4/7tMJ1BkFfhd7fW3
 7y7z/baNdHd9IUqh4YKV1+95VBvnpn0LoXO8+Kf77zsN2wsoUzZ/32Z0RKRSoQhPXNMR
 6v3X/+0JDrpmFRNu/f4SbJsSpiaOXXuLWCHCUpx3Uqewcm4laMg1WkDINHTO7dNHJdW5
 Htql/olaOWlaujM7Tk4wD2eK0vnorOlBkYeXr/iqwsTJpBhx4L3q+5YcDaQ08FS41zf2
 vzt3cukIP0C5JSE4mfBKVhOsacol4WaBZEWp2grk45x7gK591hx9JOoIWfE/9Vb/M9d7
 L9mA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=V6Tnypzqvz/Ga9wtW44Y9+fsDAdf+VkZknBDY9g6bM8=;
 b=dCs08HasbzTCiWuMueegtidV2Y16OmLpLZt5Faw2a5a27x0FocPXaWWRJGsGKFNvhe
 J21zKxJZG3IgRQGi4TWyXe6i/lwEA0ZXBNp26JGTySZbHIyW0l6HLwh0aR4e+ycmRjj6
 b0ZAN1mKbvxizUHezZAlt8anri9I6m9SVxRW5JVicRitgtFCsbM2l8PBTS5clNy0j3j6
 DU9UXzZ0kjYolhWSE4JOX8Fdu/FYsgcnII/wTCvl7DLDYAaZUl+FmwO2oHXZ6JE6r2cp
 S+C/Lo2wdLbAsRGwYkOp/74ZyuSU/ABFKauf7nv+qs8TFzu6OkZdFA46NWRRNv8AzUxs
 J3Iw==
X-Gm-Message-State: APjAAAUmSQmncay0GS/GagGUzqnH0c/PSEbZ3lwDpXkGAMsJJA7nH4Rk
 X1RVyvhoqSE6eJ420q5/wb0=
X-Google-Smtp-Source: APXvYqw8BdS0+s9un5xB5LFhfPHzvkDIQnX8RW/w9Cvkd1FWc5DWqe3wDljhGPA6BaQyugwZ0SNLIA==
X-Received: by 2002:ac8:4914:: with SMTP id e20mr7428166qtq.199.1581521069183; 
 Wed, 12 Feb 2020 07:24:29 -0800 (PST)
Received: from vhost2
 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42])
 by smtp.gmail.com with ESMTPSA id y21sm329540qto.15.2020.02.12.07.24.27
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Wed, 12 Feb 2020 07:24:28 -0800 (PST)
From: Noam Postavsky <npostavs@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN>
 <85y2texxso.fsf@HIDDEN>
 <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
Date: Wed, 12 Feb 2020 10:24:28 -0500
In-Reply-To: <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN> (Dmitry Gutov's
 message of "Wed, 12 Feb 2020 01:01:20 +0200")
Message-ID: <85lfp7ygk3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39452
Cc: 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Dmitry Gutov <dgutov@HIDDEN> writes:

> On 07.02.2020 16:43, Noam Postavsky wrote:
>> Dmitry Gutov <dgutov@HIDDEN> writes:
>>
>>> It's not so simple. FILE already goes through call-process. But Git
>>> expects a pathspec, not just a file name. So if it's a glob, it is
>>> expanded.
>>
>> You can pass --literal-pathspecs to tell git not to expand.  Magit does
>> this.  But there is a downside due to the way git implements it, which
>> is by setting an environment variable: it affects all subprocesses git
>> calls, including git-hook scripts which tends to trip people up.
>
> I wonder how bad the latter problem is.  After all, even if it
> happens, it *can* be worked around in the same scripts.

Yes, it's common enough to have a FAQ for it.
https://magit.vc/manual/magit/My-Git-hooks-work-on-the-command_002dline-but-not-inside-Magit.html




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 11 Feb 2020 23:01:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 11 18:01:30 2020
Received: from localhost ([127.0.0.1]:57710 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j1eX3-00030T-Th
	for submit <at> debbugs.gnu.org; Tue, 11 Feb 2020 18:01:30 -0500
Received: from mail-wm1-f66.google.com ([209.85.128.66]:53914)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1j1eX2-00030H-IP
 for 39452 <at> debbugs.gnu.org; Tue, 11 Feb 2020 18:01:29 -0500
Received: by mail-wm1-f66.google.com with SMTP id s10so5833862wmh.3
 for <39452 <at> debbugs.gnu.org>; Tue, 11 Feb 2020 15:01:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=6KbS6UCi+P3v40XtINg6DuCcToKm1BQ0sltEYv5RJec=;
 b=fLanfL6MxVnDCapvU6eC+3BIzp3I/+mP4an03TI10CdqEH0KnYtObJ2TodlVfME6ZW
 txEnJE0PtuAyH4ltqicXJb2aK+V69gQtumPyocYEmu39qw7LSxnBANNVUVgkoM2s/j0P
 NGsPGyYq5ykCKC7+VXvoUu0UZEkUiL7gZW+ZZ6YoejqrLVSRGdNUNM0zYmO1rj9Ce6lC
 ePwVNxOil3c+ruDnsGJS126gYEFIxYpmvJZ8K5j0Ge6B/XXC9OalXzoaOhwTjab1OM6D
 dKWbqWoHNYZWMtBIkKfiEXsGRyrWzryPUMMNn93YNZYJ5T1V3ihgUpID5LghNZ9Ud8/E
 9NOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=6KbS6UCi+P3v40XtINg6DuCcToKm1BQ0sltEYv5RJec=;
 b=fC488oFG0IgjCa+KAoB4rrlgGkjApATpNpch/HuTRZuW2sfzejASAFK9Zfq0P8dbFL
 OQgPR3CMBb94dxxSHUqPHOD6VtAp6hd4SBnqY2PM+HO21/B9KlwJm70BP/ZbMyGTvtqH
 SalzuYyU8kua7hH+3e0pYLvTcPfzOOuGIM/nR4BcoLVkzDQbwCdtP2mlBkqQfH6xjnvZ
 mNHW6UYAuEPofBMNZZN9JE7QgDEQDmDOXCucTzY7IAujOgPMjFlU4h8kVMjGc64FFS1d
 lhdnl0BtnSp3/yAWY+dIpx9toIPFkTT2q2xIQIp/3MVwaJ2VodXjAkCQtzvVPaWieP7F
 6GFw==
X-Gm-Message-State: APjAAAUFKHx7+Rc4aSzOhqqajb/Bf7Lf0q8eZ/Opz0mmAThYeK9hSVev
 K/ywzPU5/GM5xoq3k421pFg=
X-Google-Smtp-Source: APXvYqzy5navlx+QJgmxSaXv5ash0SftQQBHIeI4jdhkD5ABCOuc4inEOwdRFhuqe6p0057XGDKGRg==
X-Received: by 2002:a05:600c:2215:: with SMTP id
 z21mr8276737wml.55.1581462082694; 
 Tue, 11 Feb 2020 15:01:22 -0800 (PST)
Received: from [192.168.0.3] ([66.205.73.129])
 by smtp.googlemail.com with ESMTPSA id s1sm6859137wro.66.2020.02.11.15.01.21
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 11 Feb 2020 15:01:21 -0800 (PST)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Noam Postavsky <npostavs@HIDDEN>
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <85y2texxso.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <52f47a82-b93e-d9c2-ee94-752b289d4b96@HIDDEN>
Date: Wed, 12 Feb 2020 01:01:20 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <85y2texxso.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 39452
Cc: 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 07.02.2020 16:43, Noam Postavsky wrote:
> Dmitry Gutov <dgutov@HIDDEN> writes:
> 
>> It's not so simple. FILE already goes through call-process. But Git
>> expects a pathspec, not just a file name. So if it's a glob, it is
>> expanded.
> 
> You can pass --literal-pathspecs to tell git not to expand.  Magit does
> this.  But there is a downside due to the way git implements it, which
> is by setting an environment variable: it affects all subprocesses git
> calls, including git-hook scripts which tends to trip people up.

I wonder how bad the latter problem is. After all, even if it happens, 
it *can* be worked around in the same scripts.

The patch is much smaller than the proposed alternative:

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 61e6c642d1..bbfdbfbe52 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1751,6 +1751,7 @@ vc-git-command
          (process-environment
           (append
            `("GIT_DIR"
+            "GIT_LITERAL_PATHSPECS=1"
              ;; Avoid repository locking during background operations
              ;; (bug#21559).
              ,@(when revert-buffer-in-progress-p
@@ -1785,6 +1786,7 @@ vc-git--call
  	(process-environment
  	 (append
  	  `("GIT_DIR"
+            "GIT_LITERAL_PATHSPECS=1"
  	    ;; Avoid repository locking during background operations
  	    ;; (bug#21559).
  	    ,@(when revert-buffer-in-progress-p

And if Magit does it, it's probably okay for most of VC users too.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 7 Feb 2020 22:32:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 17:32:02 2020
Received: from localhost ([127.0.0.1]:50401 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j0CAL-0004JZ-U5
	for submit <at> debbugs.gnu.org; Fri, 07 Feb 2020 17:32:02 -0500
Received: from mout.gmx.net ([212.227.15.15]:56259)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1j0CAJ-0004JD-Cn
 for 39452 <at> debbugs.gnu.org; Fri, 07 Feb 2020 17:32:00 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1581114712;
 bh=iBZZKoe90fNqbyMS9WPn1HKqgbUCZBJs2JwMO0Jn90o=;
 h=X-UI-Sender-Class:Subject:From:To:References:Date:In-Reply-To;
 b=JxYcBtzGyN2UiWRHRU6YiaaPWF7M8yymeAHuCtyHg4fpKIhQVeygSq/mLBx16tH79
 YSl/QCo9EzFhrFBQm8eaqBqb7xOXHcGRXJ1Zoc+ievzkwnQ7XgKsTRJFkjvW9B0pcC
 tjvrlxyXqBYLPslNnEyjW+le9XjQ337MaCUeyBEk=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from sheckley.simul.de ([87.160.210.52]) by mail.gmx.com (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MDysg-1iqG0y2s1U-009whq; Fri, 07
 Feb 2020 23:31:52 +0100
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 336D619431CB;
 Fri,  7 Feb 2020 23:31:52 +0100 (CET)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
From: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>, 39452 <at> debbugs.gnu.org
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN>
 <3a7c412d-4926-9109-8545-31268ce37fca@HIDDEN>
Openpgp: preference=signencrypt
Autocrypt: addr=Wolfgang.Scherer@HIDDEN; prefer-encrypt=mutual; keydata=
 xsDiBEb46IgRBACMHOAb1KNo1Ylk+ebri+4R+bG4tyKlqBlrpv8D9/ZwRdXSGt+0DyCHoaAd
 7KW7noHapLe87DunABOjKG4nqTGv+dRiWuUBlp3I4aYRFDVa3Da+XnIYkMHKqhK59VEHQCdp
 Km42nuLS7TS+n99at9YwzTG6VBdOlBKTlRFngOjVLwCg1RGXJ6X3EjS1FKCQeXziURVpWlkD
 /2zY6Ayhxi62TS84VjikXrrmjXykAAaAmMVEyKKYb9L5pGlqiZz9g/K9xw1EUoZTYuaufquD
 v4rAGR58K/3V4CYfJLEeshMWiaXHvMmlxMznlG16/um4MvmR8B3r+cx0nOPK1JBdD2qrkNnF
 Mw8FB+zouLFB4Gt2IUC5IlOmZ8OQA/4qdU53CItzWsCr9Nux4L0qUlRweSmCnV8xGQ2wP5XI
 MawIQxxREvSrsYDG8cNnYETMg4iQFfIktwAoxCJvuFAwIB6ZxHGF4FcEZm64CXc2u7CmFLqt
 rVhXhIfMz9oEYC+HhGczGamn9ofbGTFd2hJEtPcQgWNR4f7+aKknmi2+OM0fV29sZmdhbmcg
 U2NoZXJlciA8d3NAc3ctYW10LndzPsJhBBMRAgAhBQJYmz3YAhsjBQsJCAcCBhUICQoLAgQW
 AgMBAh4BAheAAAoJEIUCr3Gr112VZZoAoLTBSTp1qGuNhLdXY04iaWCMYmHCAJ4kHPtQ6nTw
 kEq9qCHgVgXDaY7wjs7ATQRG+OiIEAQAhi0wjcxvA4tychg2NQuwBIf9LX/46l+74+QbewCn
 a4a+mw/9s5KYqLGtYMuu3/KYq9yBd53OYc7LWTLMxsGOIATSOQRhdCKYW1AanupYrC/bKNW/
 8i2QEXc7LIeYiaII0TkVdQTVZxrg9kKLQ+Vf6z04Lbfv91sVCkHKI9jxgVMAAwUD/0mkDeN0
 tllPH+NOjbkkqlOj6UOwzwIYgXmALhuAEFGXVLM2HfRV9TtJa2OoGZiuhyGXat3Jl9QK9NNv
 d/J4HSal93ZHWstPU4YIRc5uhJ1eeWwKsfTmPvbZXMKMkh+hBBJ39SZnmxfoeUzkK0EQNE2p
 PZDyjAlz03qOx6D0DHnZwkkEGBECAAkFAkb46IgCGwwACgkQhQKvcavXXZU8PwCdGmUH5mbh
 dsLYyx7qthe4hOWnW54AoJQMfmHP4uUI6ji8VkdlvO8LKtLP
Message-ID: <02dc1f27-64b2-7754-e0c0-5f09922173fa@HIDDEN>
Date: Fri, 7 Feb 2020 23:31:52 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.1
MIME-Version: 1.0
In-Reply-To: <3a7c412d-4926-9109-8545-31268ce37fca@HIDDEN>
Content-Type: multipart/mixed; boundary="------------DFBC9CFE6205859F41BECF80"
Content-Language: de-DE
X-Provags-ID: V03:K1:sZQs04zh2z1atFymy3+5I3c/VVFProhnX42E8J3H6BxE1k0tf1+
 dO7aL01HaQDTIK0AvLqBN7u7yNuUqbADhtDjvUPzHGqDkCuN+NtY5Ml0/8bqYJGu8ruyGUt
 Bxh0JrAIQzTscUMQ81A/Yax3fK9J5LsU+mlfZ2efQ0x4rUyZb2/OGI+EGncRPGfHZIkYyjs
 4DnkW6bo2MQK+b+v5l8qg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:HU7VVmnFstA=:c7RCfOz3uSYQsSzD16zhC0
 7mYgOIfsopraKnxRUf6Nv7rJ7F/m8xJPayYBh0kH5OAbTpjRsxghJuRGxXr14Zc6cndnnadI4
 2VAYULGZZ1ejOoi09NMzMT89ANslRI+uUuN93F8sQO0VOkjaT3a4PsQCd6XA1lbanGt9Umsbo
 jrKcGxNWe8sxF8fhx8rqiZ8KIwdJwg4d7Z2UuZwmB33rOrcko9v9ui3dpnCqyf/F1gJZLOkDb
 7J4jhspyJVikCbTwmTIUVor82PCh9Fbt4J8TB336/Zs6kJf++eV+/SEbzzavKP+IBEAMsPYJj
 j4L7TXbZ0iSCBwHB0Hzap8tzFIrNV9BR7QsKM5Sur1eCXrw/WyjmhroQQgBr0KTWoGgTWKjYr
 GNXbORsurZN98kvERlARH0bqM0y0B8Cw+q+722SyOfei2qd+d4FTIxUdDluG9+rl9U9s9zU0C
 VXmnmePg3SGxUPRHyBETCL6oKdPwB/Qj7OLTts0h3ZuvneN+mBTkd9PQcun9ar59/KTN7FXIt
 07bXP0WiUUrhH3byurTXyLwHSM+Cao/r9TIcTiPf14e1T04FT/ysg5p3bz4t/bVbQmiQmERBS
 wGxLrNMhhr+Znrk9jzWGJRjxxOCVnSugPBHzBq/bEk8Qpuavnwf7Sx+dIR9atSIN5yXurjWcP
 JEA7F4z19hNy4ELSY3TRjr6d2wAVq/z4Duc7fFfd292PrtSN3hovxZpUQD0TSiguSOpYz6b/I
 +Z4LXW8ZawKi9C9jqEpOzq45L8lOUu52jgWgXC9s7pEnISXIs1ZVfsJO0Ro3PUfI9nl6q+MkJ
 ruewYrcoxUIxpsBw9ysMg/vIdRoFMA+/0uZITfvSt7zwO91geWiR7MMcA64gS5kZ0CJV3e7H/
 9N0/d4L1g6cHZRcVdYQ0/qQchU2UURW0+DhOhqeQJqnpMriOrK1JnMPv2dGA0pwMlB8zIgx/j
 RNPo4dNiZ4ARaTbLTzYkwUbDxPUqt0OT2Ct2gC8Ni1OrPf7l1kTCQ5KO2x5AyXpluThknK6M/
 qfPZ4vIWmgKvFh0l63326rO2u26eJtJiX8ZfWKB9CEWpWUNPK4jHfQR3qzt5ISVu0cQ25sYqp
 6nR3WNP6IgG/Nzol/+gWfiJY5s+rDlYp2zVhBrQC19rH2vWt7t3CPfnDHuydDwxjHwxYGm6fD
 1FUXuVk8OvaXUoQzVpz1A1cRr+xMIcQYHDPig6Wmo0IsaGuDY6N4+QxCX6k27ZrnXGuyR7j9w
 5gROFsyHZIqV0zej9
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 39452
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This is a multi-part message in MIME format.
--------------DFBC9CFE6205859F41BECF80
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

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 mor=
e 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:
>>>
>>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (status (apply #'vc-git--r=
un-command-string file args)))
>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (status (apply #'vc-git--r=
un-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 tha=
t: we basically never shell-quote file names.

After some research, it seems that adding a pathspec magic to commands tha=
t support this feature is the best solution.

Here is a patch that applies vc-git--literal-pathspec, vc-git--literal-pat=
hspecs to some git commands in vc-git.el. I have tested all augmented comm=
ands in the shell and some in emacs.

(defun vc-git--literal-pathspec-inner (pathspec)
=C2=A0 "Prepend :(literal) path magic to PATHSPEC."
=C2=A0 (concat ":(literal)" pathspec))

(defun vc-git--literal-pathspec (pathspec)
=C2=A0 "Prepend :(literal) path magic to PATHSPEC."
=C2=A0 (and pathspec (vc-git--literal-pathspec-inner pathspec)))

(defun vc-git--literal-pathspecs (pathspecs)
=C2=A0 "Prepend :(literal) path magic to PATHSPECS."
=C2=A0 (mapcar #'vc-git--literal-pathspec-inner pathspecs))
=01


--------------DFBC9CFE6205859F41BECF80
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 eab5ef41ff06471d3cf9387d96a09c70e586b0e6 Mon Sep 17 00:00:00 2001
From: Wolfgang Scherer <wolfgang.scherer@HIDDEN>
Date: Fri, 7 Feb 2020 23:24:27 +0100
Subject: [PATCH] vc-git-state fails for filenames with wildcards

* lisp/vc/vc-git.el: (vc-git--literal-pathspec-inner),
(vc-git--literal-pathspec), (vc-git--literal-pathspecs) new functions
to add ":(literal)" pathspec magic.

(vc-git-registered), (vc-git-state), (vc-git-dir-status-goto-stage),
(vc-git-register), (vc-git-unregister), (vc-git-checkin),
(vc-git-find-revision), (vc-git-checkout), (vc-git-revert),
(vc-git-conflicted-files), (vc-git-print-log), (vc-git-diff),
(vc-git-previous-revision), (vc-git-next-revision),
(vc-git-delete-file), (vc-git-rename-file) functions
vc-git--literal-pathspec, vc-git--literal-pathspecs applied.
=2D--
 lisp/vc/vc-git.el | 65 ++++++++++++++++++++++++++++++++++----------------=
-----
 1 file changed, 40 insertions(+), 25 deletions(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 2caa287..1a38cef 100644
=2D-- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -217,6 +217,21 @@ toggle display of the entire list."

 ;;; BACKEND PROPERTIES

+(defun vc-git--literal-pathspec-inner (pathspec)
+  "Prepend :(literal) path magic to PATHSPEC."
+  (concat ":(literal)" pathspec))
+;; (vc-git--literal-pathspec-inner "test[56].xx")
+
+(defun vc-git--literal-pathspec (pathspec)
+  "Prepend :(literal) path magic to PATHSPEC."
+  (and pathspec (vc-git--literal-pathspec-inner pathspec)))
+;; (vc-git--literal-pathspec nil)
+;; (vc-git--literal-pathspec "test[56].xx")
+
+(defun vc-git--literal-pathspecs (pathspecs)
+  "Prepend :(literal) path magic to PATHSPECS."
+  (mapcar #'vc-git--literal-pathspec-inner pathspecs))
+
 (defun vc-git-revision-granularity () 'repository)
 (defun vc-git-checkout-model (_files) 'implicit)
 (defun vc-git-update-on-retrieve-tag () nil)
@@ -243,12 +258,12 @@ toggle display of the entire list."
                (name (file-relative-name file dir))
                (str (ignore-errors
                       (cd dir)
-                      (vc-git--out-ok "ls-files" "-c" "-z" "--" name)
+                      (vc-git--out-ok "ls-files" "-c" "-z" "--" (vc-git--=
literal-pathspec name))
                       ;; If result is empty, use ls-tree to check for del=
eted
                       ;; file.
                       (when (eq (point-min) (point-max))
                         (vc-git--out-ok "ls-tree" "--name-only" "-z" "HEA=
D"
-                                        "--" name))
+                                        "--" (vc-git--literal-pathspec na=
me)))
                       (buffer-string))))
           (and str
                (> (length str) (length name))
@@ -330,7 +345,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 (vc-git--literal-path=
spec 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.
@@ -606,28 +621,28 @@ or an empty string if none."
     (pcase (vc-git-dir-status-state->stage git-state)
       ('update-index
        (if files
-           (vc-git-command (current-buffer) 'async files "add" "--refresh=
" "--")
+           (vc-git-command (current-buffer) 'async (vc-git--literal-paths=
pecs files) "add" "--refresh" "--")
          (vc-git-command (current-buffer) 'async nil
                          "update-index" "--refresh")))
       ('ls-files-added
-       (vc-git-command (current-buffer) 'async files
+       (vc-git-command (current-buffer) 'async (vc-git--literal-pathspecs=
 files)
                        "ls-files" "-z" "-c" "-s" "--"))
       ('ls-files-up-to-date
-       (vc-git-command (current-buffer) 'async files
+       (vc-git-command (current-buffer) 'async (vc-git--literal-pathspecs=
 files)
                        "ls-files" "-z" "-c" "-s" "--"))
       ('ls-files-conflict
-       (vc-git-command (current-buffer) 'async files
+       (vc-git-command (current-buffer) 'async (vc-git--literal-pathspecs=
 files)
                        "ls-files" "-z" "-u" "--"))
       ('ls-files-unknown
-       (vc-git-command (current-buffer) 'async files
+       (vc-git-command (current-buffer) 'async (vc-git--literal-pathspecs=
 files)
                        "ls-files" "-z" "-o" "--exclude-standard" "--"))
       ('ls-files-ignored
-       (vc-git-command (current-buffer) 'async files
+       (vc-git-command (current-buffer) 'async (vc-git--literal-pathspecs=
 files)
                        "ls-files" "-z" "-o" "-i" "--directory"
                        "--no-empty-directory" "--exclude-standard" "--"))
       ;; --relative added in Git 1.5.5.
       ('diff-index
-       (vc-git-command (current-buffer) 'async files
+       (vc-git-command (current-buffer) 'async (vc-git--literal-pathspecs=
 files)
                        "diff-index" "--relative" "-z" "-M" "HEAD" "--")))
     (vc-run-delayed
       (vc-git-after-dir-status-stage git-state))))
@@ -861,12 +876,12 @@ The car of the list is the current branch."
     (when flist
       (vc-git-command nil 0 flist "update-index" "--add" "--"))
     (when dlist
-      (vc-git-command nil 0 dlist "add"))))
+      (vc-git-command nil 0 (vc-git--literal-pathspecs dlist) "add"))))

 (defalias 'vc-git-responsible-p 'vc-git-root)

 (defun vc-git-unregister (file)
-  (vc-git-command nil 0 file "rm" "-f" "--cached" "--"))
+  (vc-git-command nil 0 (vc-git--literal-pathspec file) "rm" "-f" "--cach=
ed" "--"))

 (declare-function log-edit-mode "log-edit" ())
 (declare-function log-edit-toggle-header "log-edit" (header value))
@@ -933,7 +948,7 @@ It is based on `log-edit-mode', and has Git-specific e=
xtensions.")
                (lambda (value) (when (equal value "yes") (list argument))=
)))
       ;; When operating on the whole tree, better pass "-a" than ".", sin=
ce "."
       ;; fails when we're committing a merge.
-      (apply 'vc-git-command nil 0 (if only files)
+      (apply 'vc-git-command nil 0 (if only (vc-git--literal-pathspecs fi=
les))
              (nconc (if msg-file (list "commit" "-F"
                                        (file-local-name msg-file))
                       (list "commit" "-m"))
@@ -960,7 +975,7 @@ It is based on `log-edit-mode', and has Git-specific e=
xtensions.")
 	 (coding-system-for-write 'binary)
 	 (fullname
 	  (let ((fn (vc-git--run-command-string
-		     file "ls-files" "-z" "--full-name" "--")))
+		     (vc-git--literal-pathspec file) "ls-files" "-z" "--full-name" "--"=
)))
 	    ;; ls-files does not return anything when looking for a
 	    ;; revision of a file that has been renamed or removed.
 	    (if (string=3D fn "")
@@ -977,14 +992,14 @@ It is based on `log-edit-mode', and has Git-specific=
 extensions.")
 		    (vc-git-root file)))

 (defun vc-git-checkout (file &optional rev)
-  (vc-git-command nil 0 file "checkout" (or rev "HEAD")))
+  (vc-git-command nil 0 (vc-git--literal-pathspec file) "checkout" (or re=
v "HEAD")))

 (defun vc-git-revert (file &optional contents-done)
   "Revert FILE to the version stored in the git repository."
   (if contents-done
       (vc-git-command nil 0 file "update-index" "--")
-    (vc-git-command nil 0 file "reset" "-q" "--")
-    (vc-git-command nil nil file "checkout" "-q" "--")))
+    (vc-git-command nil 0 (vc-git--literal-pathspec file) "reset" "-q" "-=
-")
+    (vc-git-command nil nil (vc-git--literal-pathspec file) "checkout" "-=
q" "--")))

 (defvar vc-git-error-regexp-alist
   '(("^ \\(.+\\)\\> *|" 1 nil nil 0))
@@ -1068,7 +1083,7 @@ This prompts for a branch to merge from."
 (defun vc-git-conflicted-files (directory)
   "Return the list of files with conflicts in DIRECTORY."
   (let* ((status
-          (vc-git--run-command-string directory "status" "--porcelain" "-=
-"))
+          (vc-git--run-command-string (vc-git--literal-pathspec directory=
) "status" "--porcelain" "--"))
          (lines (when status (split-string status "\n" 'omit-nulls)))
          files)
     (dolist (line lines files)
@@ -1140,7 +1155,7 @@ If LIMIT is a revision string, use it as an end-revi=
sion."
     (let ((inhibit-read-only t))
       (with-current-buffer buffer
 	(apply 'vc-git-command buffer
-	       'async files
+	       'async (vc-git--literal-pathspecs files)
 	       (append
 		'("log" "--no-color")
                 (when (and vc-git-print-log-follow
@@ -1392,7 +1407,7 @@ This requires git 1.8.4 or later, for the \"-L\" opt=
ion of \"git log\"."
     (if vc-git-diff-switches
         (apply #'vc-git-command (or buffer "*vc-diff*")
 	       1 ; bug#21969
-	       files
+	       (vc-git--literal-pathspecs files)
                command
                "--exit-code"
                (append (vc-switches 'git 'diff)
@@ -1475,7 +1490,7 @@ This requires git 1.8.4 or later, for the \"-L\" opt=
ion of \"git log\"."
       (let* ((fname (file-relative-name file))
              (prev-rev (with-temp-buffer
                          (and
-                          (vc-git--out-ok "rev-list" "-2" rev "--" fname)
+                          (vc-git--out-ok "rev-list" "-2" rev "--" (vc-gi=
t--literal-pathspec fname))
                           (goto-char (point-max))
                           (bolp)
                           (zerop (forward-line -1))
@@ -1503,7 +1518,7 @@ This requires git 1.8.4 or later, for the \"-L\" opt=
ion of \"git log\"."
          (current-rev
           (with-temp-buffer
             (and
-             (vc-git--out-ok "rev-list" "-1" rev "--" file)
+             (vc-git--out-ok "rev-list" "-1" rev "--" (vc-git--literal-pa=
thspec file))
              (goto-char (point-max))
              (bolp)
              (zerop (forward-line -1))
@@ -1515,7 +1530,7 @@ This requires git 1.8.4 or later, for the \"-L\" opt=
ion of \"git log\"."
           (and current-rev
                (with-temp-buffer
                  (and
-                  (vc-git--out-ok "rev-list" "HEAD" "--" file)
+                  (vc-git--out-ok "rev-list" "HEAD" "--" (vc-git--literal=
-pathspec file))
                   (goto-char (point-min))
                   (search-forward current-rev nil t)
                   (zerop (forward-line -1))
@@ -1525,10 +1540,10 @@ This requires git 1.8.4 or later, for the \"-L\" o=
ption of \"git log\"."
     (or (vc-git-symbolic-commit next-rev) next-rev)))

 (defun vc-git-delete-file (file)
-  (vc-git-command nil 0 file "rm" "-f" "--"))
+  (vc-git-command nil 0 (vc-git--literal-pathspec file) "rm" "-f" "--"))

 (defun vc-git-rename-file (old new)
-  (vc-git-command nil 0 (list old new) "mv" "-f" "--"))
+  (vc-git-command nil 0 (vc-git--literal-pathspecs (list old new)) "mv" "=
-f" "--"))

 (defvar vc-git-extra-menu-map
   (let ((map (make-sparse-keymap)))
=2D-
2.7.4


--------------DFBC9CFE6205859F41BECF80--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 7 Feb 2020 17:25:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 12:25:37 2020
Received: from localhost ([127.0.0.1]:50195 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j07No-0001TA-Qs
	for submit <at> debbugs.gnu.org; Fri, 07 Feb 2020 12:25:37 -0500
Received: from mout.gmx.net ([212.227.15.18]:38917)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1j07Nm-0001Ss-NG
 for 39452 <at> debbugs.gnu.org; Fri, 07 Feb 2020 12:25:36 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1581096328;
 bh=f2YgxxQH09RRTNNqlcLPxnlHc8ce6wrU6Bh0RXEp5To=;
 h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To;
 b=aDs6DuLr9gOyUC4xsI6biCeFnF9a+2GgFBxrohF1nYsIl6XOwQ/Rg82M5EobfzllI
 lqa7cN51+auYLKB0X5fvhK7VdBJHDTzlzK7rE4Qbl2RiILPRm+StKoZ86rVSoxD3o3
 qSvQxg6zp4z1nsAfII97JMuEzNzH04MT293dPx04=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from sheckley.simul.de ([87.160.210.52]) by mail.gmx.com (mrgmx004
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MbRk3-1jWh2f1vVh-00bpDc; Fri, 07
 Feb 2020 18:25:28 +0100
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 41ACD19431CA;
 Fri,  7 Feb 2020 18:25:27 +0100 (CET)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Dmitry Gutov <dgutov@HIDDEN>, 39452 <at> debbugs.gnu.org
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN>
From: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>
Openpgp: preference=signencrypt
Autocrypt: addr=Wolfgang.Scherer@HIDDEN; prefer-encrypt=mutual; keydata=
 xsDiBEb46IgRBACMHOAb1KNo1Ylk+ebri+4R+bG4tyKlqBlrpv8D9/ZwRdXSGt+0DyCHoaAd
 7KW7noHapLe87DunABOjKG4nqTGv+dRiWuUBlp3I4aYRFDVa3Da+XnIYkMHKqhK59VEHQCdp
 Km42nuLS7TS+n99at9YwzTG6VBdOlBKTlRFngOjVLwCg1RGXJ6X3EjS1FKCQeXziURVpWlkD
 /2zY6Ayhxi62TS84VjikXrrmjXykAAaAmMVEyKKYb9L5pGlqiZz9g/K9xw1EUoZTYuaufquD
 v4rAGR58K/3V4CYfJLEeshMWiaXHvMmlxMznlG16/um4MvmR8B3r+cx0nOPK1JBdD2qrkNnF
 Mw8FB+zouLFB4Gt2IUC5IlOmZ8OQA/4qdU53CItzWsCr9Nux4L0qUlRweSmCnV8xGQ2wP5XI
 MawIQxxREvSrsYDG8cNnYETMg4iQFfIktwAoxCJvuFAwIB6ZxHGF4FcEZm64CXc2u7CmFLqt
 rVhXhIfMz9oEYC+HhGczGamn9ofbGTFd2hJEtPcQgWNR4f7+aKknmi2+OM0fV29sZmdhbmcg
 U2NoZXJlciA8d3NAc3ctYW10LndzPsJhBBMRAgAhBQJYmz3YAhsjBQsJCAcCBhUICQoLAgQW
 AgMBAh4BAheAAAoJEIUCr3Gr112VZZoAoLTBSTp1qGuNhLdXY04iaWCMYmHCAJ4kHPtQ6nTw
 kEq9qCHgVgXDaY7wjs7ATQRG+OiIEAQAhi0wjcxvA4tychg2NQuwBIf9LX/46l+74+QbewCn
 a4a+mw/9s5KYqLGtYMuu3/KYq9yBd53OYc7LWTLMxsGOIATSOQRhdCKYW1AanupYrC/bKNW/
 8i2QEXc7LIeYiaII0TkVdQTVZxrg9kKLQ+Vf6z04Lbfv91sVCkHKI9jxgVMAAwUD/0mkDeN0
 tllPH+NOjbkkqlOj6UOwzwIYgXmALhuAEFGXVLM2HfRV9TtJa2OoGZiuhyGXat3Jl9QK9NNv
 d/J4HSal93ZHWstPU4YIRc5uhJ1eeWwKsfTmPvbZXMKMkh+hBBJ39SZnmxfoeUzkK0EQNE2p
 PZDyjAlz03qOx6D0DHnZwkkEGBECAAkFAkb46IgCGwwACgkQhQKvcavXXZU8PwCdGmUH5mbh
 dsLYyx7qthe4hOWnW54AoJQMfmHP4uUI6ji8VkdlvO8LKtLP
Message-ID: <3a7c412d-4926-9109-8545-31268ce37fca@HIDDEN>
Date: Fri, 7 Feb 2020 18:25:27 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.1
MIME-Version: 1.0
In-Reply-To: <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Language: de-DE
X-Provags-ID: V03:K1:v7LrIam9do+NdMp8OqWZzecPNkEmpvkyddWwZMRmWW3ugn6+YHl
 zYTzdbP+kS1LVKraxbesst0+N5nCYTmYHnnIQ4f1NRBkkqmmYIizRsG/nZn4gmftHvDAQtz
 6eOdYqyQs3AjLbnruWJnKtYj2VCkNTxmBuDYNoiIE+5ArPCBrgUxJ8vTcWYGw1yGAQtENcy
 yOoAubGEVLQeI47Cm2Rqg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:9NKCSFwSGN0=:DNhY298BUpZ4GbsZ3JXW6S
 lU8nBQVOHF8pXyZuXIXJy5Yv+82WO68cM0hCzUY/zen5I5STttrz8qp9jAAEfqANCSJNNBsam
 bcMYbUtOhsagYuCdzYtU4yb2KplhN+haf/ECVkdrmjA3CO8vVy+tzu1HBhbyKm72ppvzn9i+x
 nDUwIjSYkdIckmScqg4HRV230/abTy2ZPUzQHjr+53vrP2B6k1vaxTSH56qOdQ/eKZjoopfXd
 /7f8TuUjN/Se4IPYkh8FBSogFSw1u3eLk5prF66Tf4+cWhLx1BWuJhTA2Un55loRgB5qeubZC
 BqLkd0GOt2P0LemwJnmbkBtsrMFtL6ACy10KBLkR0d1TKs6JMx204yjOAy/GHGw9eB2/tQECh
 MyIxhSJUDNVmOXy+VmzETQaTvkfYpK3v5oycWxh5ZnGHnKp3F3ANjkcgFNLtbqkU9jjia6K6Z
 XCrMB1dFY+Ss/q4n2qrmDKFcCysn21HaTNigUVSsqITLB3/a9pkeqoCn5V/q/AhsC3yDLVA6k
 TAOuEX18xcdwXivmIZ0EBOh9/rkfCxTFW/OwdoILJ0WZhD9LRQMY0tWLmfeIEqWIPzJLSOfKO
 rHPk+ya/lLzp5ixWF735W1zLzKghATZ2/IhZkw9PWcy8370yFnghLPaUuD+PShGR11mua8nYc
 uknZ8ODP+trulKDohXwUpD5iJRCAePsKQu54BubZpLvMzROGLqQrnIWZaGueThbMfGn67u0gi
 wmSzCKFWUkwckEfeIoK0F2LmAPh915iycKWM+vN7D47299anJh0NrPtfFFN+ER8qao+XaXvFo
 S/BELqLnSV4jhfZvkZGXXuHJ0o2gHXmCWpwrwn9x3b+HgD8E0ZgoxZHMhg641oMg6J4yCChY9
 9AGIlUmSdyNBeIwuU7lPn4OLOakAww+BEoXkXVNYq3/lQIWKNnbCWI5dAi1ItkJSRHh89F/4C
 BK59zoeXGwJf/qVHJ68css7wmxZAL6Pj/CKImDJ0umpGfNO3f/z2cEMHO6StXjBf8qCdOPjOu
 YFiv7IFw05zLFarX3B9nYTyfZLVQftb3i3P+IJUuAt++6NCnYqAXqMi9GEJeojeNxUbvvVR1Z
 uBAIh5AtXz2OkPm4u5IvSRxlVTQMJ6TakmqooHDX1RJSqqCIABazuD5hTDDvr51MWQ3wpbnky
 c9p6eUpzzcujmw57terwdVd0SYFiWOb8/VaQAMgMxIzBsEFGbf2Y78t3k/8kxdS9MojdOg+BC
 2Afjcar1rdXrIOa58
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 39452
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

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:
>>
>> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (status (apply #'vc-git--ru=
n-command-string file args)))
>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (status (apply #'vc-git--ru=
n-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.

I finally decided to fully implement the vc ignore feature for all backend=
s. So once I am finished, I will have tested all vs-backend-state function=
s with filenames containing glob special characters.

Since call-process is already used in vc-git, the function shell-quote-arg=
ument is not really appropriate.

For the ongoing vc ignore implementation I needed a glob escape function, =
which only escapes special glob characters and backslash (see http://sw-am=
t.ws/emacs/doc/_build/html/emacs-vc-ignore-feature.html):

(defun vc-glob-escape (string)
=C2=A0 "Escape special glob characters in STRING."
=C2=A0 (save-match-data
=C2=A0=C2=A0=C2=A0 (if (string-match "[\\?*[]" string)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mapconcat (lambda (c)
=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=C2=A0 (pcase c
=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=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=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=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=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=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 (_ (char-to-s=
tring c))))
=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 string "")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 string)))

As for other occurences of glob errors in vc-git, The function vc-git-dir-=
status-files also suffers from this bug, when the FILES argument is non-ni=
l:

;; (let ((default-directory "/srv/install/linux/emacs/check-git/")) (vc-gi=
t-dir-status-files nil '("/srv/install/linux/emacs/check-git/test[56].xx")=
 (lambda (&rest args) args)))

fatal: pathspec 'test[56].xx' did not match any files
test5.xx^@test6.xx^@test[56].xx^@

Various other git commands, like vc-git-revert, vc-git-checkin also use gl=
ob expansion and are therefore broken.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 7 Feb 2020 14:44:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 09:44:01 2020
Received: from localhost ([127.0.0.1]:49033 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j04rR-0005Y2-G8
	for submit <at> debbugs.gnu.org; Fri, 07 Feb 2020 09:44:01 -0500
Received: from mail-qt1-f193.google.com ([209.85.160.193]:46973)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1j04rP-0005Xc-PX
 for 39452 <at> debbugs.gnu.org; Fri, 07 Feb 2020 09:44:00 -0500
Received: by mail-qt1-f193.google.com with SMTP id e25so1955014qtr.13
 for <39452 <at> debbugs.gnu.org>; Fri, 07 Feb 2020 06:43:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=B+1+tc76Pr2QbTN4rLIIPoASmc518FuAcs7HYEHVMVw=;
 b=ccLb54mF/tAp+BnDLuzVvDfNr/+bxekfqQh4L9qkyQsxpnQ8EOrm6FJ6l2BB5bFQiJ
 4Lo8VXPCnY09pFgezVgxpz0iGf1z3JWpYIPcGX3Ga3Cc9b+BM4+VXAEksY2juW6vrP5I
 epgovl9bfjF9hDeYfI0FaKd2AJBpwqfzD34lgdRxFV1XBtBwyIwjHivFhpqc13Nr7kxr
 CeGo8iiaeDz9gPHBuLHFdzKB3Q7VbHNmHKhN3euHy5rqov86RYJ46pWvrPBkUyT6Ptgw
 d4ZN8DdQjttwZ9nHjsBBHIWrInGy7C3JLqMNNEnXsazKUNjNY4S3X8pnGcJvUM+jYzQV
 AWow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=B+1+tc76Pr2QbTN4rLIIPoASmc518FuAcs7HYEHVMVw=;
 b=r+fh8uMKXf95kTb8LCsGqRDysRXJCnZ5kPbZnZKx4iKDv3KLEiSbjBXWcT0/M58BfA
 RWP3F6lyQULhJOu3yQRAUhO5rA41fXb0npMvPEhI1Bydp2dW3RScKtE6zGIuXxLgB+6P
 r3535jo27U+PSS+HpIRtnpPFMWkis1xpGwE0qlOI3VskswMwjFY4PMntBzXgX5cZUMTS
 qUPUCkEHxj5i3ZWojB0dbtbl46F7WAR6yuqvQbJpT3if60dq4fZGK9qSezRM3syWAr31
 I+Tx0tDsoPmSZNll0AIzCVBaT5FgAdG+Y8bkP9F0X4HfSh4nVaVw2PrkJqg0MeBSAK0v
 yEYQ==
X-Gm-Message-State: APjAAAUktK4kW+34XyFZB10O4XxRobMHf7CKR//POnAnovzHaUKDnqm2
 LYmkYfLVJO/V8pVS2o+nZYg=
X-Google-Smtp-Source: APXvYqzh6QjrDTNDiTrEoILZv6gwgKCJKL5l3jKy2AXsSfIQqTKQ9UlP/geVeWhIRtvPIgX4YXoFPw==
X-Received: by 2002:ac8:6b98:: with SMTP id z24mr7710479qts.392.1581086634216; 
 Fri, 07 Feb 2020 06:43:54 -0800 (PST)
Received: from vhost2
 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42])
 by smtp.gmail.com with ESMTPSA id v78sm1386510qkb.48.2020.02.07.06.43.52
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 07 Feb 2020 06:43:53 -0800 (PST)
From: Noam Postavsky <npostavs@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN>
Date: Fri, 07 Feb 2020 09:43:51 -0500
In-Reply-To: <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> (Dmitry Gutov's
 message of "Fri, 7 Feb 2020 11:43:36 +0300")
Message-ID: <85y2texxso.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39452
Cc: Eli Zaretskii <eliz@HIDDEN>, 39452 <at> debbugs.gnu.org,
 Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Dmitry Gutov <dgutov@HIDDEN> writes:

> It's not so simple. FILE already goes through call-process. But Git
> expects a pathspec, not just a file name. So if it's a glob, it is
> expanded.

You can pass --literal-pathspecs to tell git not to expand.  Magit does
this.  But there is a downside due to the way git implements it, which
is by setting an environment variable: it affects all subprocesses git
calls, including git-hook scripts which tends to trip people up.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 7 Feb 2020 11:43:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 06:43:25 2020
Received: from localhost ([127.0.0.1]:48944 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j022f-00068N-Bm
	for submit <at> debbugs.gnu.org; Fri, 07 Feb 2020 06:43:25 -0500
Received: from mail-lj1-f193.google.com ([209.85.208.193]:37221)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1j022d-000687-Gj
 for 39452 <at> debbugs.gnu.org; Fri, 07 Feb 2020 06:43:23 -0500
Received: by mail-lj1-f193.google.com with SMTP id v17so1810269ljg.4
 for <39452 <at> debbugs.gnu.org>; Fri, 07 Feb 2020 03:43:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=3ns24JsdkF6JzszgN8093tBAaVRg6GC9ccc4mvHzQT0=;
 b=WPojKz9ZgO9svvbfFmKOjeWVgImwZODbtCPR/F2R4r+StliGuASsxhPp573TSb6sIV
 +vrEqLIJ5qMdIKu+0Ue3ETnom2yiNsJfnFpl83Y9ObYA4h7rI194u1MXdd4tC/dIOV0B
 Ww/2+Gkw+DrBvyYt6cJeBt9mMvdoE7B2Gw/Z+lV3Vc9xrBhwnSGgVoNqIQt6W/4ZY+bg
 rzWHAy3gZOiLxxs17T+Jdeii5/Pyus19tU04jL9fNuDi04EcFe7RICfWqfeB15/3RCCU
 hyKQ36JK6vp8eeXKNCyqcIxNF4mY848xU+hS3qMXEF8FZE8v8ZV0dEOil84DLWJlNYfa
 iSYA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=3ns24JsdkF6JzszgN8093tBAaVRg6GC9ccc4mvHzQT0=;
 b=BoaLw0DRG5J4yjibGD8L0GVX9Ob/0ST8cu+/V03sMQZsxg+NgxPnc4crDOx0+WdQqI
 fUk+XM2KbMnLRViupZFIvxOW6976WxuWH2F/S4uxLTBUdKdAzoew2CaiuVObxSaTyP6G
 xv1o9Qa4w2FQb1F0qKHQXae36ELldp8s20rsHOKGiP+xE8b/x5Aoy3j2zbM8CfryEcjr
 pc6/PLnps8fWMXuOA/T7y2ZYqJe5EGijsNV62h7K5ZhXV6p0aKMeMsh8HVl+yUq1S16m
 afczWffp5n/2F7p24gUe7YO4MXKvm+GN8xnTSPR6Kekmo20Ffn7i8AWDOT0rInq32kdA
 veNA==
X-Gm-Message-State: APjAAAX51ODCvRS8zFAN7DbT2LIuQS6/kHoCtgOQLy2kssx/wnUZFxK4
 xVtqsiY7t2rhoK1ME7qcj+E=
X-Google-Smtp-Source: APXvYqwR4JrNj/AiCsR1uhrv0lN4zhDu67jb9Nmi2RlPU4fKfmMJm4TKuwm5bLQP1yXh6C0hnQ94mA==
X-Received: by 2002:a2e:a402:: with SMTP id p2mr5206519ljn.143.1581075797303; 
 Fri, 07 Feb 2020 03:43:17 -0800 (PST)
Received: from [192.168.1.142] ([178.252.127.239])
 by smtp.googlemail.com with ESMTPSA id h19sm1073811ljl.57.2020.02.07.03.43.16
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 07 Feb 2020 03:43:16 -0800 (PST)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Eli Zaretskii <eliz@HIDDEN>
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> <837e0yg335.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <5641ee6c-0b79-e405-74d5-1edf184c58cb@HIDDEN>
Date: Fri, 7 Feb 2020 14:43:15 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <837e0yg335.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On 07.02.2020 12:26, Eli Zaretskii wrote: > What I wrote was
 a response to your "we basically never quote". ...file names in vc-git.el
 because we've been relying on call-process. > Let > me correct my perhaps
 too-general response by saying "the prudent > thing is to always quote file
 names, unless the command expects a > wildcard in that argument". 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
 [178.252.127.239 listed in dnsbl.sorbs.net]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (dgutov[at]yandex.ru)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.208.193 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.208.193 listed in wl.mailspike.net]
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
X-Debbugs-Envelope-To: 39452
Cc: 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

On 07.02.2020 12:26, Eli Zaretskii wrote:
> What I wrote was a response to your "we basically never quote".

...file names in vc-git.el because we've been relying on call-process.

> Let
> me correct my perhaps too-general response by saying "the prudent
> thing is to always quote file names, unless the command expects a
> wildcard in that argument".

I would say that differently:

...to always quote files names when the command expects a wildcard, but 
we want the file name to be treated verbatim.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 7 Feb 2020 09:27:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 04:27:25 2020
Received: from localhost ([127.0.0.1]:48894 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1izzv3-0000uN-Ge
	for submit <at> debbugs.gnu.org; Fri, 07 Feb 2020 04:27:25 -0500
Received: from eggs.gnu.org ([209.51.188.92]:48696)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1izzv1-0000u0-FM
 for 39452 <at> debbugs.gnu.org; Fri, 07 Feb 2020 04:27:24 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:36692)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1izzuv-0005QJ-TO; Fri, 07 Feb 2020 04:27:17 -0500
Received: from [176.228.60.248] (port=2261 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1izzuu-0002Jt-Lz; Fri, 07 Feb 2020 04:27:17 -0500
Date: Fri, 07 Feb 2020 11:26:54 +0200
Message-Id: <837e0yg335.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN> (message from
 Dmitry Gutov on Fri, 7 Feb 2020 11:43:36 +0300)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
 <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 39452
Cc: 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> Cc: 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Fri, 7 Feb 2020 11:43:36 +0300
> 
> On 07.02.2020 10:57, Eli Zaretskii wrote:
> >> From: Dmitry Gutov <dgutov@HIDDEN>
> >> Date: Fri, 7 Feb 2020 02:00:38 +0300
> >>
> >> I wonder how many other backends commands are broken for files like
> >> that: we basically never shell-quote file names.
> > 
> > Whenever we run commands via the shell, the prudent thing is to always
> > quote file names (and in general any argument that might include
> > wildcard characters).  One advantage of call-process is that you don't
> > have to do that.
> 
> It's not so simple. FILE already goes through call-process. But Git 
> expects a pathspec, not just a file name. So if it's a glob, it is expanded.

What I wrote was a response to your "we basically never quote".  Let
me correct my perhaps too-general response by saying "the prudent
thing is to always quote file names, unless the command expects a
wildcard in that argument".




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 7 Feb 2020 08:43:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 03:43:46 2020
Received: from localhost ([127.0.0.1]:48876 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1izzEo-00086Y-KU
	for submit <at> debbugs.gnu.org; Fri, 07 Feb 2020 03:43:46 -0500
Received: from mail-lf1-f65.google.com ([209.85.167.65]:43166)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1izzEm-00086J-L9
 for 39452 <at> debbugs.gnu.org; Fri, 07 Feb 2020 03:43:45 -0500
Received: by mail-lf1-f65.google.com with SMTP id 9so974058lfq.10
 for <39452 <at> debbugs.gnu.org>; Fri, 07 Feb 2020 00:43:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=7gR4P6UdQFsdcord911udul5UZ6RvaWOiZ6KvhvHXUA=;
 b=P90sR5qvEDU5my/LvJEzPvwdSuUFadqfF3mMagwmiVwXF14ECAhBuFBOj3HDodS3pZ
 cAqYmR1PMF4tnqE73a3/wOFCAbHoSItuBLkXEj5wXDOwhrHq4KACxEXo56NeFEooGk5O
 CMzNOY0wZwduKH6PNMLRriB48+R002hLOBHH/TchoVCxiwZgx8TEOWP6w0Rw8BPEZ3Ge
 MkQlh9XMF75nI89Gq5RtfIpzvvE/BlWEAfwA3E8OE4KoiYdCIevba9JlHITK8fSV25MH
 4ena/qdlYkxGcffZrXP+cV/3zDQKPDWYTZQCtjl/kiZ5D2inCuc0rB1k+u8FQ/+F4Svx
 6pvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=7gR4P6UdQFsdcord911udul5UZ6RvaWOiZ6KvhvHXUA=;
 b=l9uKMIokH241qcEll1hYf/y0EANQgnyiLAQdYbG09F+yIK09fi5BXb5NxZxNI/Qyav
 JJzZ4eicKJqkebYQp0bHCfZNkhMo0zhgXkAMtYRbuKxIwaBZpPTOE4oz+tuQiHxUGq8d
 Ue4TkRmVsqIHZPhsbAmgoZ4MyJ94iuVtFOW1lT8fpWFV2YlNmeTorZv5Dm3lgwCG0JfX
 5SOue+CDU7bqgVFGakkqtgjUQcFpv00iRy7T6Df1YFQ/vUCi+bKjIXUSl/pLzqIRVYYW
 KQMNzLootYFIc3RviCPFoARkbGxNoy86+6btzkYvzgxqVG3ErgzuST4nnYeMPTU3nFh2
 v7/w==
X-Gm-Message-State: APjAAAXQ56uJsB9D0qDURIrJsqkr9D67+SBgdPI/0QThFqY93Xv2GH9A
 sW+mYYO9lvorL9PxhNeR6WY=
X-Google-Smtp-Source: APXvYqwS3eIsjMyozvDvZ4hcZ60RrVwBAQxPqpcH2rZ9oO4N0FxXWA4YF2/GvKCW/0iYAga1+0RfVw==
X-Received: by 2002:ac2:52a3:: with SMTP id r3mr3978590lfm.189.1581065018515; 
 Fri, 07 Feb 2020 00:43:38 -0800 (PST)
Received: from [192.168.1.142] ([178.252.127.239])
 by smtp.googlemail.com with ESMTPSA id i20sm749188lfl.79.2020.02.07.00.43.37
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 07 Feb 2020 00:43:37 -0800 (PST)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Eli Zaretskii <eliz@HIDDEN>
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> <83h802g77h.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <8f427281-510c-30c3-995f-364e22d9c1e2@HIDDEN>
Date: Fri, 7 Feb 2020 11:43:36 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <83h802g77h.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  On 07.02.2020 10:57, Eli Zaretskii wrote: >> From: Dmitry
 Gutov >> Date: Fri, 7 Feb 2020 02:00:38 +0300 >> >> I wonder how many other
 backends commands are broken for files like >> that: we basicall [...] 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
 blocked.  See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: yandex.ru]
 1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
 [178.252.127.239 listed in dnsbl.sorbs.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.167.65 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (raaahh[at]gmail.com)
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.167.65 listed in wl.mailspike.net]
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
X-Debbugs-Envelope-To: 39452
Cc: 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

On 07.02.2020 10:57, Eli Zaretskii wrote:
>> From: Dmitry Gutov <dgutov@HIDDEN>
>> Date: Fri, 7 Feb 2020 02:00:38 +0300
>>
>> I wonder how many other backends commands are broken for files like
>> that: we basically never shell-quote file names.
> 
> Whenever we run commands via the shell, the prudent thing is to always
> quote file names (and in general any argument that might include
> wildcard characters).  One advantage of call-process is that you don't
> have to do that.

It's not so simple. FILE already goes through call-process. But Git 
expects a pathspec, not just a file name. So if it's a glob, it is expanded.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 7 Feb 2020 07:58:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 02:58:25 2020
Received: from localhost ([127.0.0.1]:48829 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1izyWv-00073v-2G
	for submit <at> debbugs.gnu.org; Fri, 07 Feb 2020 02:58:25 -0500
Received: from eggs.gnu.org ([209.51.188.92]:56336)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1izyWt-00073j-Kw
 for 39452 <at> debbugs.gnu.org; Fri, 07 Feb 2020 02:58:24 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35805)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1izyWm-0003uE-Qf; Fri, 07 Feb 2020 02:58:16 -0500
Received: from [176.228.60.248] (port=4815 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1izyWl-0001vO-7S; Fri, 07 Feb 2020 02:58:16 -0500
Date: Fri, 07 Feb 2020 09:57:54 +0200
Message-Id: <83h802g77h.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
In-reply-to: <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN> (message from
 Dmitry Gutov on Fri, 7 Feb 2020 02:00:38 +0300)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
 <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 39452
Cc: 39452 <at> debbugs.gnu.org, Wolfgang.Scherer@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> From: Dmitry Gutov <dgutov@HIDDEN>
> Date: Fri, 7 Feb 2020 02:00:38 +0300
> 
> I wonder how many other backends commands are broken for files like 
> that: we basically never shell-quote file names.

Whenever we run commands via the shell, the prudent thing is to always
quote file names (and in general any argument that might include
wildcard characters).  One advantage of call-process is that you don't
have to do that.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at 39452 <at> debbugs.gnu.org:


Received: (at 39452) by debbugs.gnu.org; 6 Feb 2020 23:00:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 06 18:00:48 2020
Received: from localhost ([127.0.0.1]:48730 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1izq8d-0000uL-RN
	for submit <at> debbugs.gnu.org; Thu, 06 Feb 2020 18:00:48 -0500
Received: from mail-lj1-f193.google.com ([209.85.208.193]:35329)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1izq8c-0000u9-PA
 for 39452 <at> debbugs.gnu.org; Thu, 06 Feb 2020 18:00:47 -0500
Received: by mail-lj1-f193.google.com with SMTP id q8so82069ljb.2
 for <39452 <at> debbugs.gnu.org>; Thu, 06 Feb 2020 15:00:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=P8dqNSF0NtKg8hBDXsGGEWpWTkgLd9Ij6+a3v1oqTs4=;
 b=dXMTNKLxHpbUCyTBsr0UEecjplXBihHbU7bPkAbteIa05AiY+20HJKwyHNeU/TEjQD
 UC+izek37hv+zLh3YPY5K/oJOZXudYiXkMXGn8NdHUFnK/CuTs/c+/iwdSmQnh6EZLKo
 2mriTdLnidqquTuGrAFpjG4moBNykvxdI7EzQFQzcCiC0ttouMt0/WON+68Jhe9dVW1k
 OQIG4QqprPJXbvlq3HHDTz1EyDZ5d0hNE1rhk8jU4PU0YCTX8HlAyXsMNr7qJ/e52HXC
 v+Z8Qaz1IUWSJSRbwlI+Q3frT2DiCXijrrZTss7qgxDKeM7U/WFzjr/bTIMTutOgDoB/
 CgPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=P8dqNSF0NtKg8hBDXsGGEWpWTkgLd9Ij6+a3v1oqTs4=;
 b=TvmGzpsqPILLG9pkJH2P/CxASdXJ8HismcxjUm+UkgrIXK4RFRu3iIwUvzsp8EaVcp
 e4x2LPYYQlMzChRb45aBpDPbNh9+f6Bboq9MdFRZjX1tz+mehJZnjkV0GK/OA94eyGSK
 IWr1NMQX/1Ze/5v9TfRS8JJzmVOXpRN8EQIdf4lkhj5wtxd2ThzxLuetW/X/nTfF/Win
 pX0xem/90A5zCQIJFKR4xUXfVgWTKs939Yd0EvLn1QW7rx3zlMeFtv4m4Jy6GWA5+y5J
 o3YhOCHvS0PLng/3K0nzD0R7Eop3QbxLNWwRHCbjOWccWeReG8vZtCp8m30zX7pCIKB2
 Tq4A==
X-Gm-Message-State: APjAAAXl7qOLU6sXsYV6zB0m4IYjClQKvMQAIQiZueLweoxYIkse/6SH
 fGnpjRz4TQQCGRq42jlbETv065ii5VQ=
X-Google-Smtp-Source: APXvYqxgn0lpeu4HcDcHrxEDq+a0bE9txhK1Mj0tF7ByHkpkou6AKK1payb+xM5DBgJF+64aDQ9mLw==
X-Received: by 2002:a2e:94c8:: with SMTP id r8mr3491655ljh.28.1581030040033;
 Thu, 06 Feb 2020 15:00:40 -0800 (PST)
Received: from [192.168.1.142] ([178.252.127.239])
 by smtp.googlemail.com with ESMTPSA id 144sm270422lfi.67.2020.02.06.15.00.38
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 06 Feb 2020 15:00:39 -0800 (PST)
Subject: Re: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards
To: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>, 39452 <at> debbugs.gnu.org
References: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <da916f04-ca02-ab00-4864-cddfcc463e25@HIDDEN>
Date: Fri, 7 Feb 2020 02:00:38 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
MIME-Version: 1.0
In-Reply-To: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Hi Wolfgang, 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`: > >  
   -rw-r-- [...] 
 
 Content analysis details:   (2.0 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (raaahh[at]gmail.com)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [209.85.208.193 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [209.85.208.193 listed in wl.mailspike.net]
  1.5 RCVD_IN_SORBS_WEB      RBL: SORBS: sender is an abusable web server
                             [178.252.127.239 listed in dnsbl.sorbs.net]
  0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
                             EnvelopeFrom freemail headers are
                             different
X-Debbugs-Envelope-To: 39452
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

Hi Wolfgang,

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`:
> 
>    -rw-r--r--  1 ws ws    0 Feb  6 08:51 test[56].xx
>    -rw-r--r--  1 ws ws    0 Feb  6 08:51 test5.xx
>    -rw-r--r--  1 ws ws    0 Feb  6 08:51 test6.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
> --- 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<= "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 because
>           ;; the file is not in a git repo.
> 

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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Feb 2020 13:59:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 06 08:59:36 2020
Received: from localhost ([127.0.0.1]:47148 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1izhgu-0000WH-9U
	for submit <at> debbugs.gnu.org; Thu, 06 Feb 2020 08:59:36 -0500
Received: from lists.gnu.org ([209.51.188.17]:44366)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1izhgs-0000W8-BA
 for submit <at> debbugs.gnu.org; Thu, 06 Feb 2020 08:59:34 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:41056)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1izhgr-0008UH-1q
 for bug-gnu-emacs@HIDDEN; Thu, 06 Feb 2020 08:59:34 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 RCVD_IN_DNSWL_LOW,SPOOFED_FREEMAIL,URIBL_BLOCKED autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1izhgp-0000uT-VL
 for bug-gnu-emacs@HIDDEN; Thu, 06 Feb 2020 08:59:32 -0500
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 <Wolfgang.Scherer@HIDDEN>)
 id 1izhgp-0000jL-HL
 for bug-gnu-emacs@HIDDEN; 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
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
 <bug-gnu-emacs@HIDDEN>; Thu, 06 Feb 2020 14:59:26 +0100
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 <bug-gnu-emacs@HIDDEN>; Thu,  6 Feb 2020 14:59:26 +0100 (CET)
To: Emacs Bugs <bug-gnu-emacs@HIDDEN>
From: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>
Subject: [PATCH] vc-git-state fails for filenames with wildcards
Openpgp: preference=signencrypt
Autocrypt: addr=Wolfgang.Scherer@HIDDEN; prefer-encrypt=mutual; keydata=
 xsDiBEb46IgRBACMHOAb1KNo1Ylk+ebri+4R+bG4tyKlqBlrpv8D9/ZwRdXSGt+0DyCHoaAd
 7KW7noHapLe87DunABOjKG4nqTGv+dRiWuUBlp3I4aYRFDVa3Da+XnIYkMHKqhK59VEHQCdp
 Km42nuLS7TS+n99at9YwzTG6VBdOlBKTlRFngOjVLwCg1RGXJ6X3EjS1FKCQeXziURVpWlkD
 /2zY6Ayhxi62TS84VjikXrrmjXykAAaAmMVEyKKYb9L5pGlqiZz9g/K9xw1EUoZTYuaufquD
 v4rAGR58K/3V4CYfJLEeshMWiaXHvMmlxMznlG16/um4MvmR8B3r+cx0nOPK1JBdD2qrkNnF
 Mw8FB+zouLFB4Gt2IUC5IlOmZ8OQA/4qdU53CItzWsCr9Nux4L0qUlRweSmCnV8xGQ2wP5XI
 MawIQxxREvSrsYDG8cNnYETMg4iQFfIktwAoxCJvuFAwIB6ZxHGF4FcEZm64CXc2u7CmFLqt
 rVhXhIfMz9oEYC+HhGczGamn9ofbGTFd2hJEtPcQgWNR4f7+aKknmi2+OM0fV29sZmdhbmcg
 U2NoZXJlciA8d3NAc3ctYW10LndzPsJhBBMRAgAhBQJYmz3YAhsjBQsJCAcCBhUICQoLAgQW
 AgMBAh4BAheAAAoJEIUCr3Gr112VZZoAoLTBSTp1qGuNhLdXY04iaWCMYmHCAJ4kHPtQ6nTw
 kEq9qCHgVgXDaY7wjs7ATQRG+OiIEAQAhi0wjcxvA4tychg2NQuwBIf9LX/46l+74+QbewCn
 a4a+mw/9s5KYqLGtYMuu3/KYq9yBd53OYc7LWTLMxsGOIATSOQRhdCKYW1AanupYrC/bKNW/
 8i2QEXc7LIeYiaII0TkVdQTVZxrg9kKLQ+Vf6z04Lbfv91sVCkHKI9jxgVMAAwUD/0mkDeN0
 tllPH+NOjbkkqlOj6UOwzwIYgXmALhuAEFGXVLM2HfRV9TtJa2OoGZiuhyGXat3Jl9QK9NNv
 d/J4HSal93ZHWstPU4YIRc5uhJ1eeWwKsfTmPvbZXMKMkh+hBBJ39SZnmxfoeUzkK0EQNE2p
 PZDyjAlz03qOx6D0DHnZwkkEGBECAAkFAkb46IgCGwwACgkQhQKvcavXXZU8PwCdGmUH5mbh
 dsLYyx7qthe4hOWnW54AoJQMfmHP4uUI6ji8VkdlvO8LKtLP
Message-ID: <c099084a-ebf9-74d3-7661-854a00c46169@HIDDEN>
Date: Thu, 6 Feb 2020 14:59:26 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.1
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------27A05B47FDAE0E731A585AE8"
Content-Language: de-DE
X-Provags-ID: V03:K1:fqbQYM+9g2vmCbm/iYzw3mxoliuWRP6XKfaRUGszsFATLJ8ZL4Q
 cPwhipKOAtxnILScdgs475lc2Utxey7Z8T6SoFFVJaRdnbjSaeYHuZDn9MA8fE9oCEim3+m
 qhUOuojBU/U9ALSa0MJMwEkJn3SrZn/HGUKDLyiyjbm5qcg+QJ8GQTgeUIfEdEy3JB8/tE4
 wQFOYl9+6/+EQOKIF63jA==
X-UI-Out-Filterresults: notjunk:1;V03:K0:7ZwZDgUGiZM=:sFGLNx/UZY29pYGbS9o59/
 mPVQb71jf3SIrDPxYzdx1EQmTLXsvEu2hIWPgAlhfBZ3ZUQQHJfrpQfDWwZQpLxwUdjq5YG6e
 eBcLpsd3tYT2njlCfjH8/Q5bPj0+kHKTcEwiwHSUa6b05uuFNhXZuNPMTRRmtRK1vOuHVHQ3t
 vRkndR+GMXm6cZlZYZr7KYkTi/MzKjirtJZzNZbpr4795yp/a+0H2mUO7d1+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+XpAgzX6mQxd
 nzAunbBSZpApL587Mcngnmitts94wTqEBj0vfwF34Yt6YmzYRJiQJNjFJkFVqe2NKlibFg6aj
 AcgMDmEFn0VgEssXsEfp8I4HzDVWGXp9tQjau/UC5M2KVWnnL++EIDRgIXSYA8wmvy9KKU0NI
 gjm+mjUtpDnrEsh/SJ8mCnduSelfJTqFCZzwldYwu+23Nisea0mSy84jKTokMAj7EdZgpNqQ9
 rp64VzJF5k8jDW7gC6dhCUh3UdguoxFu/N8usnKch0Q+qrvSvKg1Oce/ZQi/PH2UJJGyVjvhp
 tuAzc0LSLBUkEAZtwljBNgbgdnzx38Hwj6HkpeYzbeXmm8JKgaElC1FApfnmifzFZsQwb1GJ2
 7a8LU+WsYzy8ug00PBVxJb2F1JjTf5SRI8ajYdQsy0FqxfxdR+olSXgRsSKUXT/ct6nGtitM6
 EY/TaVjV969SYeD/5
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.15.18
X-Spam-Score: 2.2 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  When a filename contains shell wildcard characters matching
    one or more files, e.g. `test[56].xx` matching both `test5.xx` and `test6.xx`:
      -rw-r--r--  1 ws ws    0 Feb  6 08:51 test[56].xx   -rw-r--r-- 
    1 ws ws    0 Feb  6 08:51 test5.xx   -rw-r--r--  1 ws ws    0 Feb 
    6 08:51 test6.xx 
 
 Content analysis details:   (2.2 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
                             blocked.  See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                              for more information.
                             [URIs: gmx.de]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
 [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;id=wolfgang.scherer%40gmx.de;ip=209.51.188.17;r=debbugs.gnu.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (wolfgang.scherer[at]gmx.de)
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [209.51.188.17 listed in list.dnswl.org]
  2.0 SPOOFED_FREEMAIL       No description available.
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

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 <wolfgang.scherer@HIDDEN>
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--




Acknowledgement sent to Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#39452; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 14 Feb 2020 20:45:02 UTC

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