From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: master 370b216f086: New variable 'project-files-relative-names' Date: Sun, 5 May 2024 20:28:56 +0300 Message-ID: References: <171487980736.28387.14971069985522275144@vcs2.savannah.gnu.org> <20240505033008.78DF3C2BC8C@vcs2.savannah.gnu.org> <87r0egu23d.fsf@gmx.de> <86cyq0ei31.fsf@gnu.org> <86zft4cpea.fsf@gnu.org> <41d7d4e9-1566-4df1-90dc-8d7f6d06dee2@gutov.dev> <86plu0cjqj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30773"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: michael.albinus@gmx.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 05 19:29:48 2024 Return-path: Envelope-to: ged-emacs-devel@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 1s3fgI-0007pI-J3 for ged-emacs-devel@m.gmane-mx.org; Sun, 05 May 2024 19:29:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3ffj-0004Rt-WF; Sun, 05 May 2024 13:29:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3fff-0004OJ-Ku for emacs-devel@gnu.org; Sun, 05 May 2024 13:29:07 -0400 Original-Received: from fhigh3-smtp.messagingengine.com ([103.168.172.154]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3ffZ-00025P-BQ; Sun, 05 May 2024 13:29:07 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 221BA11400BA; Sun, 5 May 2024 13:28:59 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 05 May 2024 13:28:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1714930139; x=1715016539; bh=jr5RcVb/rF3Y6psrm25lsyaguQGi6BYEM2hiZMizvc8=; b= qEf9zUuzhlp0Q4sgsppK7v6eaACY2WS5ThEoIeZTo/fLZhuqZJs3dymUQ3iKF9W/ 31zQSS3Yxnv+s/u8Go2kS4YX6Aq5W87fFcvCs2HHrRovMne5z7rC3bj9+JobBRDt qpPHITQdrDxs20/CFzJlhSW2t1fk2/P298oM8GL8BolLHbtYHGES7kzkE/veDiEI 4euuAeiUTfn336s3HEmXpsreshc+SPGPV7suFcqhKQz8yuZk4YCb09QYy/vmej7I ZlCH18Acng1MCiKdEHWvhnw5Q1y4JG80x6030aIp/4BjlBbnY5zb7bV0YRyjGle3 yS3PchOdXSnX25roEfDLog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714930139; x= 1715016539; bh=jr5RcVb/rF3Y6psrm25lsyaguQGi6BYEM2hiZMizvc8=; b=j AT5Xj85sC0qIzaqHg7uzpMvbWX5vOI5DRPjCDRHZp7zuizhZtg2nQLwwWH7U6MKL 7SCVcs9GB7N9yvz2FZtBP3UL2rOmnbueMVjrmGL8Sqj4kwwD0vSRkO4IRQXRhb9T luG5z2azsIuIcG3Q97TRJuDkjTkOKsIiFyCKuQmss4s19JL16khzE3fZ8v/V08vw 0XxQ9YJkyEcsterbaCR+4sWdigXirDyCl3DtJdWVuxmF8CqCor/T7Qmk+GMgdE3b EmfpGwyUlASrobcc1NvK04AaMolxYynB+Y1f5eXQlrKPQBIyQSSclMOrJjendeT3 JElzYCfpagAaNWjld8M6Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvgedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeethefhheekleekhfetgedvudfhhffhkefhgeeuffejleevheejuefgteej teevtdenucffohhmrghinhepshhtrggtkhhovhgvrhhflhhofidrtghomhdpkhhgrhiird hiohenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegu mhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 May 2024 13:28:57 -0400 (EDT) Content-Language: en-US In-Reply-To: <86plu0cjqj.fsf@gnu.org> Received-SPF: pass client-ip=103.168.172.154; envelope-from=dmitry@gutov.dev; helo=fhigh3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318851 Archived-At: On 05/05/2024 19:21, Eli Zaretskii wrote: >> Date: Sun, 5 May 2024 18:46:30 +0300 >> Cc: michael.albinus@gmx.de, emacs-devel@gnu.org >> From: Dmitry Gutov >> >> On 05/05/2024 17:19, Eli Zaretskii wrote: >>> After some debugging, the reason seems to be the use of that >>> ":(exclude,glob,top)%s" thingie in project--vc-list-files. Which >>> version of Git introduced it? >> >> I don't know the exact version, but git pathspecs are mentioned in this >> 2014 SO question and in this 2015 article: >> >> https://stackoverflow.com/questions/27711924/whats-a-pathspec-in-the-git-command >> https://kgrz.io/git-intro-to-pathspec.html >> >> That seems old enough to me? >> >> And the use of this feature was added to project.el in 2020, FWIW. > > Maybe it's some other problem with it, because these pathspecs are > documented in my Git's man pages, but the commands I tried came up > with an empty list on my system, but with a non-empty list on another > one, where a newer Git is installed. Could you perhaps show an > example of such a command line that I could try here? BTW, the pathspecs are only used when the EXTRA-IGNORES argument is non-nil. Meaning project-vc-ignores is set, either globally or through dir-locals. Perhaps you have a value in there that confuses Git? Here's what the command looks like if I just set project-vc-ignores to '("./test"): git --no-pager ls-files -z -c --exclude-standard -o -- :(exclude,glob,top)test . > Regardless, top of the backtrace from the failure looks like this: > > Test project-vc-supports-project-in-different-dir backtrace: > string-match("\0" nil 0) > split-string(nil "\0" t) > project--vc-list-files("d:/gnu/git/emacs/trunk/test/lisp/progmodes/p > > IOW, it tries to split-string nil. Yeah, the error was somewhat cryptic. I've now pushed a patch below that should print the VCS command used when an error happens, see if it makes things more clear. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index a3181340411..52fe4df9080 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -648,7 +648,7 @@ project-files (list (project-root project))))) (declare-function vc-git--program-version "vc-git") -(declare-function vc-git--run-command-string "vc-git") +(declare-function vc-git-command "vc-git") (declare-function vc-hg-command "vc-hg") (defun project--vc-list-files (dir backend extra-ignores) @@ -701,7 +701,8 @@ project--vc-list-files file (concat default-directory file)))) (split-string - (apply #'vc-git--run-command-string nil "ls-files" args) + (with-output-to-string + (apply #'vc-git-command standard-output 0 nil "ls-files" args)) "\0" t)))) (when (project--vc-merge-submodules-p default-directory) ;; Unfortunately, 'ls-files --recurse-submodules' conflicts with '-o'.