From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#39452: [PATCH] vc-git-state fails for filenames with wildcards Date: Wed, 12 Feb 2020 01:01:20 +0200 Message-ID: <52f47a82-b93e-d9c2-ee94-752b289d4b96@yandex.ru> References: <83h802g77h.fsf@gnu.org> <8f427281-510c-30c3-995f-364e22d9c1e2@yandex.ru> <85y2texxso.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="2147"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: 39452@debbugs.gnu.org, Wolfgang.Scherer@gmx.de To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 12 00:02:15 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j1eXm-0000T5-Nm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Feb 2020 00:02:14 +0100 Original-Received: from localhost ([::1]:58164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1eXl-00036m-Nl for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Feb 2020 18:02:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54346) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1eXd-00035X-B3 for bug-gnu-emacs@gnu.org; Tue, 11 Feb 2020 18:02:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1eXa-0004qV-UL for bug-gnu-emacs@gnu.org; Tue, 11 Feb 2020 18:02:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51737) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1eXa-0004nu-8H for bug-gnu-emacs@gnu.org; Tue, 11 Feb 2020 18:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1eXa-00031D-5C for bug-gnu-emacs@gnu.org; Tue, 11 Feb 2020 18:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Feb 2020 23:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39452 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39452-submit@debbugs.gnu.org id=B39452.158146209011566 (code B ref 39452); Tue, 11 Feb 2020 23:02:02 +0000 Original-Received: (at 39452) by debbugs.gnu.org; 11 Feb 2020 23:01:30 +0000 Original-Received: from localhost ([127.0.0.1]:57710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1eX3-00030T-Th for submit@debbugs.gnu.org; Tue, 11 Feb 2020 18:01:30 -0500 Original-Received: from mail-wm1-f66.google.com ([209.85.128.66]:53914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1eX2-00030H-IP for 39452@debbugs.gnu.org; Tue, 11 Feb 2020 18:01:29 -0500 Original-Received: by mail-wm1-f66.google.com with SMTP id s10so5833862wmh.3 for <39452@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) Original-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) In-Reply-To: <85y2texxso.fsf@gmail.com> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175961 Archived-At: On 07.02.2020 16:43, Noam Postavsky wrote: > Dmitry Gutov 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.