From unknown Fri Jun 20 07:21:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#73320 <73320@debbugs.gnu.org> To: bug#73320 <73320@debbugs.gnu.org> Subject: Status: [PATCH] project--vc-list-files: use Git's sparse-index Reply-To: bug#73320 <73320@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:21:56 +0000 retitle 73320 [PATCH] project--vc-list-files: use Git's sparse-index reassign 73320 emacs submitter 73320 Sean Allred severity 73320 normal tag 73320 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 17 12:56:14 2024 Received: (at submit) by debbugs.gnu.org; 17 Sep 2024 16:56:14 +0000 Received: from localhost ([127.0.0.1]:55830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqbUr-000872-Ru for submit@debbugs.gnu.org; Tue, 17 Sep 2024 12:56:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:41138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqbUp-00086u-Vh for submit@debbugs.gnu.org; Tue, 17 Sep 2024 12:56:12 -0400 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 1sqbUZ-0006pt-4T for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 12:55:56 -0400 Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqbUT-00021T-AI for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 12:55:52 -0400 Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e0b7efa1c1bso5820585276.3 for ; Tue, 17 Sep 2024 09:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726592147; x=1727196947; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=JOYOH4yhCF5Ms2cqAGuuWfD+M2oDCacc+iudk+KZxiw=; b=C93v5lGbe4yGUp1X2sPW2bo3yYMa9WwBjkhjHIQrbDtYo0T3NKxhCRBvZWC7r229P2 5CaIcLV1X88nstTfN9LcS/YYAJVpausJ6VRIWqdut2puMDt9KH7ExWSNwbyGnhrJl/vv uzP8KRdVzh/iMcXZ5OE4UTQ5yX/+r3n4kCWW2QTicKViWaFnVShqlcbDeYM8QRUz3p3J 0yXMg3LHRIZkEFEh+E28TxTPEZOnb5DA17bogUISeyHE5EYaMa0um6DS/zBdGjbkYohA 1tNfh8dIbgHH+P20QeIyX+Xs4b4V+N0mZtRmsS0LMhAqPG7ah3KwOPsf/uJyWB80TtJW lm6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726592147; x=1727196947; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=JOYOH4yhCF5Ms2cqAGuuWfD+M2oDCacc+iudk+KZxiw=; b=q/84FYM+5tePUdmLKbDOCZClD2butmyBhqwo5tuv/fWfyFDT+sORvQCn/SL98sBDh/ KO5O4nP9NVxd71iYMu9lFYaYrvvdpQ0sPY8pLjGMm6obEDy7ashGLDok+aUGubUHRvwL rQo/qZC4oegFny+LgXHVA6BV3IQpz44Op1sV/6SGbAJLufsMjDkL948qdjxU52hd/SHs yQ5+KjpbhqSbjYW2OMjStjo8w5Rb8YxvfxIUA0SjeHMosOEfEPY2CGMzDgTO2ksz12HL LyqU2QYxQRhyJKjI7yyViG6+cZzZ6fuM2xTNxfW9SkCay+j/n1JFAM+cJd51faH63efs GSvA== X-Gm-Message-State: AOJu0Yzd+14+K0HWsk50efdbJWDYDEbbfoVHkrbECJCYYnCx9CXMVNGi 7iGcNHG8mxVqAx8He4UXXC+tSjw/F0X1aFf86pVyOYVFwJjDgtw7EQySMg== X-Google-Smtp-Source: AGHT+IGbmLYccGHqJbyKECKiRjR/ouIGC/IC8FAz4QLE82DT/AAjNrp5cnoKPzVjQXXa0J+SS7cBBw== X-Received: by 2002:a05:690c:640e:b0:6db:de99:28ae with SMTP id 00721157ae682-6dbde992a62mr107339937b3.17.1726592145948; Tue, 17 Sep 2024 09:55:45 -0700 (PDT) Received: from epic96565.epic.com (pat-verona-k.epic.com. [199.204.56.216]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6dc314c7a9fsm13240557b3.115.2024.09.17.09.55.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 09:55:44 -0700 (PDT) From: Sean Allred To: bug-gnu-emacs@gnu.org Subject: [PATCH] project--vc-list-files: use Git's sparse-index Date: Tue, 17 Sep 2024 11:55:43 -0500 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::b33; envelope-from=allred.sean@gmail.com; helo=mail-yb1-xb33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Tags: patch Hello! I noticed that `C-x p f` (M-x project-find-file) took an incredibly long time to run on our monorepo -- even when using a sparse index -- and I tracked the problem down to this function. Adding `--sparse` to the `git-ls-files` invocation resolves the issue handily, albeit with the quirk of still showing top-level directories that are excised from the sparse index (which we may want to remove from the return value of this function since it does say it returns /files/). I'm expecting at least one more version of this patch before it's even considered for merge. Given that this change removes many, many results from the return value of `project--vc-list-files', I suspect this would be a breaking change for some use case that I'm not considering. I'm hoping the list can provide some feedback on the best way to make this configurable. I've not really hacked in project.el before and am not super familiar with its internals. If you prefer, you may pull this patch from my fork on github at url: git@github.com:vermiculus/emacs.git branch: sa/sparse-index Keep in mind I may be updating this branch with feedback from this list as it comes in. -Sean In GNU Emacs 29.1 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.6.6 (Build 21G646)) of 2023-07-30 built on armbob.lan Windowing system distributor 'Apple', version 10.3.2487 System Description: macOS 14.6.1 Configured using: 'configure --with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules 'CFLAGS=-DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=no' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-project-vc-list-files-use-Git-s-sparse-index.patch >From e72c013afbafad3faf19f98acb8d0387fdf045ba Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Tue, 17 Sep 2024 10:07:41 -0500 Subject: [PATCH] project--vc-list-files: use Git's sparse-index When dealing with exceptionally large Git repositories, the performance of `project-find-file` can suffer dramatically as the list of files is collected for completion. This adds insult to injury when you consider cases where the developer has configured the repository to use a sparse checkout where the vast majority of these files are not even present on disk and are not valid candidates for completion. Unconditionally pass along the `--sparse` option to `git-ls-files` to coerce `project--vc-list-files` only consider files present in the sparse index (and presumably on disk). No consideration is made to make this configurable as it is currently unclear as to the best way to do this -- whether to follow the example of the `include-untracked` symbol in this function or to adopt some other mechanism. --- lisp/progmodes/project.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b29d5ed5404..82cb79322dd 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -663,7 +663,7 @@ project--vc-list-files (pcase backend (`Git (let* ((default-directory (expand-file-name (file-name-as-directory dir))) - (args '("-z")) + (args '("-z", "--sparse")) (vc-git-use-literal-pathspecs nil) (include-untracked (project--value-in-dir 'project-vc-include-untracked base-commit: 7d365a2d72d8e656262205827cc5fdf423c3a41f -- 2.46.0 --=-=-= Content-Type: text/plain -- Sean Allred --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 17 18:54:45 2024 Received: (at 73320) by debbugs.gnu.org; 17 Sep 2024 22:54:45 +0000 Received: from localhost ([127.0.0.1]:56207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqh5p-000304-4z for submit@debbugs.gnu.org; Tue, 17 Sep 2024 18:54:45 -0400 Received: from fhigh7-smtp.messagingengine.com ([103.168.172.158]:57547) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqh5m-0002zq-CM for 73320@debbugs.gnu.org; Tue, 17 Sep 2024 18:54:43 -0400 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 882C51140214; Tue, 17 Sep 2024 18:54:20 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Tue, 17 Sep 2024 18:54:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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=fm3; t=1726613660; x=1726700060; bh=aaLlRPZVHvunSrkot59WWpoIOe0X6TtJQpkgiyaf6M4=; b= ax3YNxE6l/n5otYBopvxBoBGJSgjPwDMMJ/qjGxSSz5nPhkKDgGFTF+gqzmlIVoB lrzJmz8+/c8IuiepTEESSpzhKxGy3eleL+YiPZlK0Ygk8ehAXg3Yv1UuH56bufip 7+RJH9OzefQFma9mdzefBEUp0bDbjpJ55HuVf0/cdZR77A3e3laH3GHoFNQ+lIl7 IeNZg5iiy9rrEwth17rUXeRT4A16Nssk3IvATlRN5rJYAxOtu1plPmhdzF2/+sU6 wQfdFuguPW52TcBOh8kURvNnBOd0eI8Grpbhh1cKrs8uAeNJZREeeAMg2tNO3iYX 6iq6XLeiEBeCWKsId1D9rw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm1; t=1726613660; x= 1726700060; bh=aaLlRPZVHvunSrkot59WWpoIOe0X6TtJQpkgiyaf6M4=; b=F er0QJsejE1ls/AXHk2k0QAJt5VX0rf7j8zVY643rDganN10/L/t058tDis6DGZ84 zC1J7Oh9WETL3LQdDZQLiRy+UJ246TWnxyqnfkeML1BawK7RR/Q1+cAXSLILzF6f FCDECN+A3LoW2/4wFz5wWn/D3G+qZA717vuMSVd70TqEQeTZMneGdh7ifqBO5ebK j5iqyDUEjbjtlJCZx9WodjtPviRTo48hvRBk7tH8YwO+QO567+U7rD38XDHeA9TZ rjKeCjFrqHkBjGvkydNup4CSxGQEqVGRgGa4QjttWOUzG5L8tPI1GXaKjfBSM+2M 22XitJiNBM85MzV4kVzAA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudekkedgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg hvqeenucggtffrrghtthgvrhhnpedthfeuvddtveelgeeuleevvdejveehffevveehvdeu ffdtfefhvdeugefgtefgtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohep vddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghllhhrvggurdhsvggrnhesgh hmrghilhdrtghomhdprhgtphhtthhopeejfeefvddtseguvggssghughhsrdhgnhhurdho rhhg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Sep 2024 18:54:19 -0400 (EDT) Message-ID: Date: Wed, 18 Sep 2024 01:54:17 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index To: Sean Allred , 73320@debbugs.gnu.org References: Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi! On 17/09/2024 19:55, Sean Allred wrote: > I noticed that `C-x p f` (M-x project-find-file) took an incredibly long > time to run on our monorepo -- even when using a sparse index -- and I > tracked the problem down to this function. That sounds like a good problem to try to solve. > Adding `--sparse` to the > `git-ls-files` invocation resolves the issue handily, albeit with the > quirk of still showing top-level directories that are excised from the > sparse index (which we may want to remove from the return value of this > function since it does say it returns /files/). The submitted patch has a comma inside which results in an error vc-delistify: Wrong type argument: characterp, \, Removing it fixes the error. But let's start from the beginning. Could you help me set up a sparse repo that would help test out the change? I took a large-ish checkout with shallow history and set up the sparse config like this: git sparse-checkout init --cone git sparse-checkout set gfx media With that, both 'git status' and 'ls' behave as expected - no extra directories around (just the top-level files and two subdirs). But 'git ls-files' and 'git ls-files --sparse' continue to show the same large output. Any idea what could be wrong? My version of Git, perhaps? Which is 2.40.1. > I'm expecting at least one more version of this patch before it's even > considered for merge. Given that this change removes many, many results > from the return value of `project--vc-list-files', I suspect this would > be a breaking change for some use case that I'm not considering. Yeah, I expect project-find-regexp, project-search, project-query-replace-regexp might start misbehaving without additional filtering -- either throwing up errors or, best case, continuing to search through the "hidden" directories. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 17 20:38:05 2024 Received: (at 73320) by debbugs.gnu.org; 18 Sep 2024 00:38:05 +0000 Received: from localhost ([127.0.0.1]:56257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqihp-0000F9-5b for submit@debbugs.gnu.org; Tue, 17 Sep 2024 20:38:05 -0400 Received: from mail-qv1-f45.google.com ([209.85.219.45]:61591) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqihn-0000EQ-EM for 73320@debbugs.gnu.org; Tue, 17 Sep 2024 20:38:03 -0400 Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-6c548eb3354so49502276d6.2 for <73320@debbugs.gnu.org>; Tue, 17 Sep 2024 17:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726619802; x=1727224602; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=4chl5jCAOVfwJTot+zD697tY36EkTrOJuwSG2w2aPPY=; b=hhG1/GIHUK2ku83J3WMyCL04yKORmifeKe3IXaCU6YwHpKB93RhsEpbYUyPib0WS2u z/mC5u4iGVgVFXqhrKlrCdZ2Fuh3T23XsItwEotMtz4FhptVSMTUy7hlliIR8eZcDsg9 L/t0fjFh+4zOoTJe2ZZuogjNIjaNAiBTUSYp+mPhrjHNLKH4OvzQaFkJ60oXjVqLFFGD UDeC3G/HFD2YvoipIUWbrLXr7WCriZj/33BOCz7532Cm2yhhAvsY6ynuahFEjmGA5aUo 6V/eUu/QXv/i/xc92bxAEhWEA5F7D/w70B1CYUUMIcJvn+Hz5klMV5AMKEtsGKBrlMs6 ol0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726619802; x=1727224602; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4chl5jCAOVfwJTot+zD697tY36EkTrOJuwSG2w2aPPY=; b=pyJOqdtTdd+7YnI0dOeO0gEzg8jqMDtPbjbM80nHaKnojrhNyGAoXeheKMPTIlDyil w1zt9pymy4IiTGbLKikeJQuQhvLUUvA+ZA8Ancb4kbf6Xv7O17bE5dHC6TzN7kTx4Fe+ +vmR5GlP08I0HGztlO4ypVjJ0Ix96qvCCDt7NNvli0iIORJ6xYaTHLh10zEwG0nzYVjp ptnVOL/NMlU+3Sv3tgiZ4Cg1+GP4ftCsgHlBBK4yzJAV8Kki8bu/OhjPk1bm67LxnkA+ 0IQV/Wy6K1mY/ain7ZidAH+KE9TacOZ05SLvGr+gLCXzzhb3tv2ScKPnCJLxRylnyKB3 ac0Q== X-Gm-Message-State: AOJu0YycR3VPvoEoD04ovu06CJGCVaEO+DVcIEdY8kFI2+L4aqSkWtxG +rCUnVHSWD4Dm3b3BIAwZR8dloxGxeJFQNp4pnyfHiKKdTl8SCnq+ooVxw== X-Google-Smtp-Source: AGHT+IEqkOiAp5jHYde7FsbUf0pSa1i/1OBaa1I0/vS5LrMotSGZe4OwWwkF+WsN3lL9zZUxFTjBNg== X-Received: by 2002:a05:6214:4a06:b0:6c5:279b:5dc7 with SMTP id 6a1803df08f44-6c573568623mr337762486d6.25.1726619801917; Tue, 17 Sep 2024 17:36:41 -0700 (PDT) Received: from epic96565.epic.com (syn-075-135-086-025.res.spectrum.com. [75.135.86.25]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c58c635395sm39799016d6.52.2024.09.17.17.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 17:36:41 -0700 (PDT) From: Sean Allred To: Dmitry Gutov Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index In-Reply-To: (Dmitry Gutov's message of "Wed, 18 Sep 2024 01:54:17 +0300") References: Date: Tue, 17 Sep 2024 19:36:40 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 73320 Cc: 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > The submitted patch has a comma inside which results in an error Well that's embarrassing. I've resolved this in my branch. I'm not sure why I wasn't seeing an issue locally; perhaps I made this error somehow after I eval'd the form for testing. Thanks for catching! > But let's start from the beginning. Could you help me set up a sparse > repo that would help test out the change? > > I took a large-ish checkout with shallow history and set up the sparse > config like this: > > git sparse-checkout init --cone > git sparse-checkout set gfx media > > With that, both 'git status' and 'ls' behave as expected - no extra > directories around (just the top-level files and two subdirs). > > But 'git ls-files' and 'git ls-files --sparse' continue to show the > same large output. Any idea what could be wrong? My version of Git, > perhaps? Which is 2.40.1. Sure! You're very close. The key is here in git-ls-files(1): --sparse If the index is sparse, show the sparse directories without expanding to the contained files. Sparse directories will be shown with a trailing slash, such as "x/" for a sparse directory "x". combined with this in git-sparse-checkout(1): Use the --[no-]sparse-index option to use a sparse index (the default is to not use it). I fell into this too when setting up my worktree for testing; normally our internal tooling takes care of this for me. To resolve this issue in an existing checkout, you can simply git sparse-checkout init --sparse-index and that will rewrite your index file using sparse-index rules. > Yeah, I expect project-find-regexp, project-search, > project-query-replace-regexp might start misbehaving without > additional filtering -- either throwing up errors or, best case, > continuing to search through the "hidden" directories. Not sure how best to track that we should come back to this, but yeah. It seems like the right place to add some sort of switch would be in the `project-files` defmethod. From here, it looks like all the functions you mention could choose the behavior right for them. (Based on the function names alone -- it seems they would /also/ be interested in operating on only those files which exist on disk.) Incidentally looking at the version check within `project-files`, it's worthwhile to point out that `--sparse` is likely /not/ compatible with ancient versions of Git. Does vc have any sort of policy on requiring recent versions of these tools? If the answer is 'not really', I'll additionally want to add some sort of protection against using `--sparse` when the Git version won't understand it. This should be easy enough to do within the implementation of `project--vc-list-files`. -- Sean Allred From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 18 18:27:32 2024 Received: (at 73320) by debbugs.gnu.org; 18 Sep 2024 22:27:32 +0000 Received: from localhost ([127.0.0.1]:59361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr391-0000Ky-LO for submit@debbugs.gnu.org; Wed, 18 Sep 2024 18:27:32 -0400 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]:58025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr38z-0000Kd-36 for 73320@debbugs.gnu.org; Wed, 18 Sep 2024 18:27:30 -0400 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id C97511140122; Wed, 18 Sep 2024 18:27:06 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Wed, 18 Sep 2024 18:27:06 -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=fm3; t=1726698426; x=1726784826; bh=gEl2kfhz4a30d2JO4FbO9y6aKk6bSUzDpeRwyQi3X3E=; b= ePpfDalQIKxWEihW5b3X6BEvwVdhhMLj6p4tMebjqc6UruBIlZ4GKcow6tOgvw3D dXfoHH0phpykqFzfHmb1e9rfwKOe+dt6X8YJ2TcMKd/7SEF+eSlcec2Z19mOKjBp i98EEGt28uwzB+roJwncQIOqh0y9llIvUWur7U5NrwUtqCBOxpm9F64SkepmO1DN 887ACq/LoENxbwyyp7IfPLvR0rLvRydLHNGx0XyJVklIgkhOK7CeypqskmeA8mhT nX9zG7uMwtj3tVF86DSJeRP3/kiBDAzJeeYB9WA0wiNHczlDD+t8SHtIYqV7Cv9z 7+qj3tywKIZLkRZPoF1TMQ== 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=fm1; t=1726698426; x= 1726784826; bh=gEl2kfhz4a30d2JO4FbO9y6aKk6bSUzDpeRwyQi3X3E=; b=Y EVpwBhtfK9IC13P7ObEraCFM4iU3hMF+yQVkDF3wx7xyUFKCLldch9tsb4+Rw+o6 xuFWcniI1E2LBi0i515cpMaJ07r7IvZw4+Cj8pA6iiZH4yH1UW/wwX//j/Klcg4w NhoVLUHbWRzt9cf/HhYMLweNlm4N0sz3v0iYOQO6Iyt/ZfJwkjqcDUOIUskHf9iH Q4GUEC7PkvffafyRjLT5FCucuOk2UvcR5W+8Xm+xTQMigrBjF3TqqcjrnlX2tbmx 5ZwISW51bzKQyqj5NFCQeo9e4aq591SyWSNwH8QvdgWvUAXjnlY+6/ROFydXK0oJ lwHv3Jv/W8hK90d4YvZ0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeltddgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieekueef tddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho pedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrlhhlrhgvugdrshgvrghnse hgmhgrihhlrdgtohhmpdhrtghpthhtohepjeeffedvtdesuggvsggsuhhgshdrghhnuhdr ohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Sep 2024 18:27:05 -0400 (EDT) Message-ID: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> Date: Thu, 19 Sep 2024 01:27:03 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index To: Sean Allred References: Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 Cc: 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 18/09/2024 03:36, Sean Allred wrote: > Dmitry Gutov writes: >> The submitted patch has a comma inside which results in an error > > Well that's embarrassing. I've resolved this in my branch. I'm not sure > why I wasn't seeing an issue locally; perhaps I made this error somehow > after I eval'd the form for testing. Thanks for catching! No problem! >> But let's start from the beginning. Could you help me set up a sparse >> repo that would help test out the change? >> >> I took a large-ish checkout with shallow history and set up the sparse >> config like this: >> >> git sparse-checkout init --cone >> git sparse-checkout set gfx media >> >> With that, both 'git status' and 'ls' behave as expected - no extra >> directories around (just the top-level files and two subdirs). >> >> But 'git ls-files' and 'git ls-files --sparse' continue to show the >> same large output. Any idea what could be wrong? My version of Git, >> perhaps? Which is 2.40.1. > > Sure! You're very close. The key is here in git-ls-files(1): > > --sparse > If the index is sparse, show the sparse directories without > expanding to the contained files. Sparse directories will be shown > with a trailing slash, such as "x/" for a sparse directory "x". > > combined with this in git-sparse-checkout(1): > > Use the --[no-]sparse-index option to use a sparse index (the > default is to not use it). > > I fell into this too when setting up my worktree for testing; normally > our internal tooling takes care of this for me. To resolve this issue in > an existing checkout, you can simply > > git sparse-checkout init --sparse-index > > and that will rewrite your index file using sparse-index rules. Thanks! So the key here is using "sparse index", not just "sparse checkout", since these are two different features. Which have to be enabled separately for sort of "gradual rollout", I guess. >> Yeah, I expect project-find-regexp, project-search, >> project-query-replace-regexp might start misbehaving without >> additional filtering -- either throwing up errors or, best case, >> continuing to search through the "hidden" directories. > > Not sure how best to track that we should come back to this, but yeah. > It seems like the right place to add some sort of switch would be in the > `project-files` defmethod. From here, it looks like all the functions > you mention could choose the behavior right for them. (Based on the > function names alone -- it seems they would /also/ be interested in > operating on only those files which exist on disk.) I think we can just remove the names ending with '/'. The built-in commands don't seem to error out on them right now - probably because there is some protection against nonexistent files - but those files are (were) still shown as completions for project-find-file. Try out this addition please. The performance here seems about the same even with a large list (something I was worried about): diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b29d5ed5404..a2e3f3f52e6 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -663,7 +663,7 @@ project--vc-list-files (pcase backend (`Git (let* ((default-directory (expand-file-name (file-name-as-directory dir))) - (args '("-z")) + (args '("-z" "--sparse")) (vc-git-use-literal-pathspecs nil) (include-untracked (project--value-in-dir 'project-vc-include-untracked @@ -703,7 +703,8 @@ project--vc-list-files (delq nil (mapcar (lambda (file) - (unless (member file submodules) + (unless (or (member file submodules) + (eq ?/ (aref file (1- (length file))))) (if project-files-relative-names file (concat default-directory file)))) > Incidentally looking at the version check within `project-files`, it's > worthwhile to point out that `--sparse` is likely /not/ compatible with > ancient versions of Git. Does vc have any sort of policy on requiring > recent versions of these tools? If the answer is 'not really', I'll > additionally want to add some sort of protection against using > `--sparse` when the Git version won't understand it. This should be easy > enough to do within the implementation of `project--vc-list-files`. IIRC it was something like "should work on the CentOS stable", and maybe CentOS N-1 as well. But the release-based distro was discontinued since the last time this question came up ;-( We can call vc-git--program-version the same way it's used in vc-git-state. Which version should we make the minimum? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 19 00:27:28 2024 Received: (at 73320) by debbugs.gnu.org; 19 Sep 2024 04:27:28 +0000 Received: from localhost ([127.0.0.1]:59579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr8lM-0002jJ-0e for submit@debbugs.gnu.org; Thu, 19 Sep 2024 00:27:28 -0400 Received: from mail-il1-f182.google.com ([209.85.166.182]:60697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr8lH-0002iv-Bn for 73320@debbugs.gnu.org; Thu, 19 Sep 2024 00:27:26 -0400 Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3a09dd37ceaso1706405ab.1 for <73320@debbugs.gnu.org>; Wed, 18 Sep 2024 21:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726719960; x=1727324760; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Jc6wqY66udr+WSJ8DzWKxfIKPwdF0DpIzspM25WBpzI=; b=gZ9vOOxbIbGNnc5WMHPOVG/k+WtlbxJd4rAhCAKDausU9AfTRcq/5kvsz89Pa95fgg EbuAVNj4mc/Rz20CphF+hO2dilg2Tfg+TjlWESgelUY3iFFMEhwH2eq7kOXtgZfQCkV7 2mupFjSaEsre8WsLXI3gVyZzzq2j5dJZ8pWduqVXiUMXhoUpHFBW3FXAAzX9urJiesMB GpWXWxLQsfN6z2xNkAQgKagMOc25wTjP0p+tEZfFUIOn8KSbz/o1uH5U7D+O3yTlUV/8 wJ0M1PEA2C5khwJ+iO7qmENVphoY+ffECjQTLthfnWtxVhi474po9eR5NtQVc3rqOIkz pbwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726719960; x=1727324760; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Jc6wqY66udr+WSJ8DzWKxfIKPwdF0DpIzspM25WBpzI=; b=ScIZWVX6uZd7PJzb1LWM9+kQMQY8IWaoXg9QYlzsQbX9i+RNDC82tF1jAfBiRc0yCK bP3kdlnW5cUHoW+6N7NEGteblt0FC00wmO4OpRuJWZsQkQIvxtQ+XSUKDGfbaUkt0ve0 xaACh2NQaZ87Id7PmWvK3vwqUUDDXRF8rQ5HBtzUTxkfLXXjbnCP1mBi3+xUuVXiVNi3 ffPHWirDj1Uk53FlM/Up39gpsk0WqSY0r13upRYgVOGUowREZvgqzMrjeHy7hi05SOBV 8jay7ZK19/TeeKaKb7LqApw5ezZYmLBSZ+yQx8HTLAZ8yQerQ3FnO0SA5MW3exDHFpLh 8Hlg== X-Gm-Message-State: AOJu0YzJryggRnkw0jfO2smOusbNTBTASJe/sSlttT2Ea4Yb9yum1Khn MgbgVGXJaSkBFg0mHv1xj0LiC8FlPXXDUFEPdWEG1Aeua+tZPjZoqlyqOw== X-Google-Smtp-Source: AGHT+IHHyWcS6h56WxlPdfe6NuHcCG8g0sgrFvDzujI+seYyPMKtkIsGOoxbIot/kvorvSppjiv5Qg== X-Received: by 2002:a05:6e02:1a68:b0:39f:5557:857f with SMTP id e9e14a558f8ab-3a084900bc8mr217782625ab.6.1726719960211; Wed, 18 Sep 2024 21:26:00 -0700 (PDT) Received: from epic96565.epic.com (syn-075-135-086-025.res.spectrum.com. [75.135.86.25]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a092e8fecasm32095455ab.80.2024.09.18.21.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 21:25:59 -0700 (PDT) From: Sean Allred To: Dmitry Gutov Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index In-Reply-To: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> (Dmitry Gutov's message of "Thu, 19 Sep 2024 01:27:03 +0300") References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> Date: Wed, 18 Sep 2024 23:25:57 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 73320 Cc: 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: >>> Yeah, I expect project-find-regexp, project-search, >>> project-query-replace-regexp might start misbehaving without >>> additional filtering -- either throwing up errors or, best case, >>> continuing to search through the "hidden" directories. >> Not sure how best to track that we should come back to this, but >> yeah. >> It seems like the right place to add some sort of switch would be in the >> `project-files` defmethod. From here, it looks like all the functions >> you mention could choose the behavior right for them. (Based on the >> function names alone -- it seems they would /also/ be interested in >> operating on only those files which exist on disk.) > > I think we can just remove the names ending with '/'. The built-in > commands don't seem to error out on them right now - probably because > there is some protection against nonexistent files - but those files > are (were) still shown as completions for project-find-file. Try out > this addition please. The performance here seems about the same even > with a large list (something I was worried about): > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index b29d5ed5404..a2e3f3f52e6 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -663,7 +663,7 @@ project--vc-list-files > (pcase backend > (`Git > (let* ((default-directory (expand-file-name > (file-name-as-directory dir))) > - (args '("-z")) > + (args '("-z" "--sparse")) > (vc-git-use-literal-pathspecs nil) > (include-untracked (project--value-in-dir > 'project-vc-include-untracked > @@ -703,7 +703,8 @@ project--vc-list-files > (delq nil > (mapcar > (lambda (file) > - (unless (member file submodules) > + (unless (or (member file submodules) > + (eq ?/ (aref file (1- (length file))))) > (if project-files-relative-names > file > (concat default-directory file)))) Works fine for me :-) Though I've added an additional version check inlined below. >> Incidentally looking at the version check within `project-files`, it's >> worthwhile to point out that `--sparse` is likely /not/ compatible with >> ancient versions of Git. [...] > > [...] > > We can call vc-git--program-version the same way it's used in > vc-git-state. Which version should we make the minimum? The `--sparse` option was introduced in 2.35. The following seems to work well for me: diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b29d5ed5404..873bc92729d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -663,7 +663,8 @@ project--vc-list-files (pcase backend (`Git (let* ((default-directory (expand-file-name (file-name-as-directory dir))) - (args '("-z")) + (args `("-z" ,@(when (version<= "2.35" (vc-git--program-version)) + '("--sparse")))) (vc-git-use-literal-pathspecs nil) (include-untracked (project--value-in-dir 'project-vc-include-untracked @@ -703,7 +704,8 @@ project--vc-list-files (delq nil (mapcar (lambda (file) - (unless (member file submodules) + (unless (or (member file submodules) + (eq ?/ (aref file (1- (length file))))) (if project-files-relative-names file (concat default-directory file)))) Since we're getting a bit busy with our conditions, though, it might be better to start using `cond`: diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 873bc92729d..b42415154e3 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -704,11 +704,11 @@ project--vc-list-files (delq nil (mapcar (lambda (file) - (unless (or (member file submodules) - (eq ?/ (aref file (1- (length file))))) - (if project-files-relative-names - file - (concat default-directory file)))) + (cond + ((member file submodules) nil) + ((eq ?/ (aref file (1- (length file)))) nil) + (project-files-relative-names file) + (t (concat default-directory file)))) (split-string (with-output-to-string (apply #'vc-git-command standard-output 0 nil "ls-files" args)) This seems to help readability -- at least to me. There's probably also a nominal performance benefit since `cond` is a special form. I've pushed this as branch `sa/sparse-index-2` to my repository. (This is in addition to the `sa/sparse-index` branch, which contains the `file-exists-p` check mentioned below plus what might be, I take it, an ultimately unneeded opt-out parameter in `project-files`.) It's worth noting that actually performing a `file-exists-p` check here would have the added benefit of handling the awkward state between Git 2.25 (where sparse-checkout was introduced) and 2.35 (where git-ls-files learned --sparse) where ls-files could still report things that _look_ like files but are not present. This would be fixed by just replacing the (eq ..) form with (not (file-exists-p file)). -- Sean Allred From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 19 01:41:29 2024 Received: (at 73320) by debbugs.gnu.org; 19 Sep 2024 05:41:29 +0000 Received: from localhost ([127.0.0.1]:59629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr9uy-00071j-OJ for submit@debbugs.gnu.org; Thu, 19 Sep 2024 01:41:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr9uv-00071Q-TN for 73320@debbugs.gnu.org; Thu, 19 Sep 2024 01:41:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sr9uZ-0005fC-CN; Thu, 19 Sep 2024 01:41:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=a6Q5gwr2u8xYNEf3G1NFZ27weEmHwYOrxzQ+ePqwMIM=; b=dE9mTveGHSre XxfEzyJWOX/o4VUqUxQ9jAjXdD3T+6QvaVfW44SBdnNs8iz5+gxteChnWscZVheCRX8TOi3Ur9lQy W5iSPkOV4obislb+59P3VmRzGKWj21bSRhXZ/9uLHJWqEPrFX2RL8wfGKb28DTAkqd7cmJ9JfDaIT 2XW9bewIA1LAh5kdEC0ObYoPcjbgxEc358i1IBOERyfLkMl1Y5msPCjCmlF9tBjVbJXB26Mn4blzn AuVqPCagsr0+AJtPWEuc2IJ4LOEtpF8kfiVgiZC8UjfBh4nk7dJziXJhiDo7zrwaMIxidvLwsusVT vDF9nUGmrFqaZdzSKXCLlg==; Date: Thu, 19 Sep 2024 08:41:01 +0300 Message-Id: <868qvo9p5e.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> (message from Dmitry Gutov on Thu, 19 Sep 2024 01:27:03 +0300) Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73320 Cc: allred.sean@gmail.com, 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 73320@debbugs.gnu.org > Date: Thu, 19 Sep 2024 01:27:03 +0300 > From: Dmitry Gutov > > - (unless (member file submodules) > + (unless (or (member file submodules) > + (eq ?/ (aref file (1- (length file))))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Why not use directory-name-p here? > > Incidentally looking at the version check within `project-files`, it's > > worthwhile to point out that `--sparse` is likely /not/ compatible with > > ancient versions of Git. Does vc have any sort of policy on requiring > > recent versions of these tools? If the answer is 'not really', I'll > > additionally want to add some sort of protection against using > > `--sparse` when the Git version won't understand it. This should be easy > > enough to do within the implementation of `project--vc-list-files`. > > IIRC it was something like "should work on the CentOS stable", and maybe > CentOS N-1 as well. But the release-based distro was discontinued since > the last time this question came up ;-( > > We can call vc-git--program-version the same way it's used in > vc-git-state. Which version should we make the minimum? In which version was --sparse support introduced, and what is considered "ancient" for this purpose? I would not like us to rely on shining new features of Git if the price is to break people who have older versions. TRT in these cases is to probe the version and act accordingly, using the new features only when they are supported. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 19 05:35:21 2024 Received: (at 73320) by debbugs.gnu.org; 19 Sep 2024 09:35:21 +0000 Received: from localhost ([127.0.0.1]:59813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srDZJ-0002tu-86 for submit@debbugs.gnu.org; Thu, 19 Sep 2024 05:35:21 -0400 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]:47985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srDZG-0002tH-Ku for 73320@debbugs.gnu.org; Thu, 19 Sep 2024 05:35:20 -0400 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 955701380397; Thu, 19 Sep 2024 05:34:55 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Thu, 19 Sep 2024 05:34:55 -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=fm3; t=1726738495; x=1726824895; bh=3vTrazICJx5W34PE3L6z7H5GwPudKwbIivFbrQBQZM4=; b= FBJJnv6HStF4ISUV1UZ6Y76sPdiYZB6EM4zN49F4m8cKiHZMToTgiUMv7kqdguhY mY+8fw+XExCIOg/V77pZdXK31rpNg05r/rLGhIsf08k34TjZk8qKDUzD8wVVmOil QSxj37r8QKIe+p94v2VRuLWZI7/uxmiLjG81Y9c0py0M1pGKDE5RCCCJ/oFEKsHD mvkOwLVXJJCXcNmALUdES6x+e+9tn0E/ZhdON2aWawzr+73ZagIqGWlJZ3YMPMJl i5VZNZ2wcUYhu5ZXbLMvbg5evsgfzSINvhe1hg/C/NmfGFz4WfthNTfb0waPP1gk 7AhRI/+awFEA7ulJWCSAJQ== 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=fm2; t=1726738495; x= 1726824895; bh=3vTrazICJx5W34PE3L6z7H5GwPudKwbIivFbrQBQZM4=; b=D VV3+Hb/TDU94gpCyO+RyuSxo1Eo99H4vILFlO+O8cBjRvpFIQUInj2HV+y2L/wjZ TXVvcova23bvbB1VEmVGJOnQZsK7Sy7jdXpdPhg03D/TdlccgpWE1nWRAcuMQZfd mhbTDbXxshTAJh7DVgYuUhv9jRCGgU5vKXZTYYsRzYJ+sIOTTEvto0Q6mCNuZKFe pbqeEmpss3HVMx/sljJf5Sqc5XSCRCbv2s/yNHqC71BAxkv3tsUK9qk9Cl5mSJ7N MDhT09XZEJZpkJsx5+KP7BwxakQZIw3cfzBYL1x7zkE0y/YGozEl85Mfjmb/O9ia mGGzXR1tkYwpM/7eNi6dw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeluddgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieekueef tddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrgh dprhgtphhtthhopegrlhhlrhgvugdrshgvrghnsehgmhgrihhlrdgtohhmpdhrtghpthht ohepjeeffedvtdesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Sep 2024 05:34:54 -0400 (EDT) Message-ID: Date: Thu, 19 Sep 2024 12:34:51 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index To: Eli Zaretskii References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> <868qvo9p5e.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <868qvo9p5e.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 Cc: allred.sean@gmail.com, 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 19/09/2024 08:41, Eli Zaretskii wrote: >> Cc: 73320@debbugs.gnu.org >> Date: Thu, 19 Sep 2024 01:27:03 +0300 >> From: Dmitry Gutov >> >> - (unless (member file submodules) >> + (unless (or (member file submodules) >> + (eq ?/ (aref file (1- (length file))))) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Why not use directory-name-p here? Thanks for the suggestion, I forgot that it's available and fast. We might want to likewise update completion-emacs22-try-completion and vc-git--file-list-is-rootdir. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 19 05:45:11 2024 Received: (at 73320) by debbugs.gnu.org; 19 Sep 2024 09:45:11 +0000 Received: from localhost ([127.0.0.1]:59818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srDip-0003PC-DB for submit@debbugs.gnu.org; Thu, 19 Sep 2024 05:45:11 -0400 Received: from fhigh5-smtp.messagingengine.com ([103.168.172.156]:34421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srDik-0003OL-PT for 73320@debbugs.gnu.org; Thu, 19 Sep 2024 05:45:10 -0400 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id DD30E1140247; Thu, 19 Sep 2024 05:44:43 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 19 Sep 2024 05:44:43 -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=fm3; t=1726739083; x=1726825483; bh=18b+FWGOZQoVzXqYIvFmJxUFDNbpunjTD31kWGnI3vk=; b= GfICfI68oI+I71834CoIQh1HH6mvVpyccbNFkH80w0P67tGOH/YZcFBucABaqLdz 5mTWBzjbe2GQ/Xq76Ps4xWagAtHStIl/NNTiMbYhVu+aJ9x/YZtJRY6TZfn14A1z Bd7el1hol0DDIyPZpWVVWMzZBna2qcUILF+ZzwxN+Bf0cwuIubaK/T7oRhzrWpHZ UeZhkJ3iBF57AufoMweouBET8/VMfisIK1vwWNiR0CbPOeJrGHg9TkrvWT0SZ4HN PB3+l1RmQHrr0m03Aqj/7h3n6pFpV9W0A9RWvhR34QKwJctc0fa6SJ/Kf33yALii GrWnXqYRtgm24tUGShNbiA== 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=fm2; t=1726739083; x= 1726825483; bh=18b+FWGOZQoVzXqYIvFmJxUFDNbpunjTD31kWGnI3vk=; b=J pJf0i9dw2f2u0w88rnFXbEZibRcgAANq6CQmHHR/zw6Cixg1CTAqV82Ns10xWkB1 Yc59GGZ0E08uolslwPNQe3fz6Lz+RQugjm7K3MnmKhWl7XFth88ud9v332xVRhcs TE+boC0kp17ruU0K+kEpaDCD3NZRm+hMk4+Lfe6D8wx8k/w/UXfEF/zlMYSOGZVh AVW2glUfSl3RE5xXvWqoH0KdHDVzzKbb2x5LSuXRfXWhjsfAE2zuR05P53BGxc9S ne3DWeq1z/sx/KyyzbZjCrSRWyS13cCzrhBFLt2IuhxoyLZYirNSkjOMvwDWYRne qDKxJpFErSh7J+/x1+79A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeluddgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieekueef tddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho pedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrlhhlrhgvugdrshgvrghnse hgmhgrihhlrdgtohhmpdhrtghpthhtohepjeeffedvtdesuggvsggsuhhgshdrghhnuhdr ohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Sep 2024 05:44:42 -0400 (EDT) Message-ID: <96ddaf6a-ffdc-4c1f-9141-ee14b41ebd11@gutov.dev> Date: Thu, 19 Sep 2024 12:44:40 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index To: Sean Allred References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 Cc: 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 19/09/2024 07:25, Sean Allred wrote: >> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el >> index b29d5ed5404..a2e3f3f52e6 100644 >> --- a/lisp/progmodes/project.el >> +++ b/lisp/progmodes/project.el >> @@ -663,7 +663,7 @@ project--vc-list-files >> (pcase backend >> (`Git >> (let* ((default-directory (expand-file-name >> (file-name-as-directory dir))) >> - (args '("-z")) >> + (args '("-z" "--sparse")) >> (vc-git-use-literal-pathspecs nil) >> (include-untracked (project--value-in-dir >> 'project-vc-include-untracked >> @@ -703,7 +703,8 @@ project--vc-list-files >> (delq nil >> (mapcar >> (lambda (file) >> - (unless (member file submodules) >> + (unless (or (member file submodules) >> + (eq ?/ (aref file (1- (length file))))) >> (if project-files-relative-names >> file >> (concat default-directory file)))) > > Works fine for me :-) Though I've added an additional version check > inlined below. Great, thanks! >>> Incidentally looking at the version check within `project-files`, it's >>> worthwhile to point out that `--sparse` is likely /not/ compatible with >>> ancient versions of Git. [...] >> >> [...] >> >> We can call vc-git--program-version the same way it's used in >> vc-git-state. Which version should we make the minimum? > > The `--sparse` option was introduced in 2.35. The following seems to > work well for me: > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index b29d5ed5404..873bc92729d 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -663,7 +663,8 @@ project--vc-list-files > (pcase backend > (`Git > (let* ((default-directory (expand-file-name (file-name-as-directory dir))) > - (args '("-z")) > + (args `("-z" ,@(when (version<= "2.35" (vc-git--program-version)) > + '("--sparse")))) > (vc-git-use-literal-pathspecs nil) > (include-untracked (project--value-in-dir > 'project-vc-include-untracked > @@ -703,7 +704,8 @@ project--vc-list-files > (delq nil > (mapcar > (lambda (file) > - (unless (member file submodules) > + (unless (or (member file submodules) > + (eq ?/ (aref file (1- (length file))))) > (if project-files-relative-names > file > (concat default-directory file)))) Like Eli suggested, we can use directory-name-p instead of the second condition. > Since we're getting a bit busy with our conditions, though, it might be > better to start using `cond`: > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index 873bc92729d..b42415154e3 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -704,11 +704,11 @@ project--vc-list-files > (delq nil > (mapcar > (lambda (file) > - (unless (or (member file submodules) > - (eq ?/ (aref file (1- (length file))))) > - (if project-files-relative-names > - file > - (concat default-directory file)))) > + (cond > + ((member file submodules) nil) > + ((eq ?/ (aref file (1- (length file)))) nil) > + (project-files-relative-names file) > + (t (concat default-directory file)))) > (split-string > (with-output-to-string > (apply #'vc-git-command standard-output 0 nil "ls-files" args)) > > This seems to help readability -- at least to me. There's probably also > a nominal performance benefit since `cond` is a special form. I think I'd rather keep the 'unless' for now: it groups the first two cases a bit more clearly. > I've pushed this as branch `sa/sparse-index-2` to my repository. (This > is in addition to the `sa/sparse-index` branch, which contains the > `file-exists-p` check mentioned below plus what might be, I take it, an > ultimately unneeded opt-out parameter in `project-files`.) Yeah, it doesn't seem to be useful to return files that don't exist in the current work directory - no idea what a caller would do with them. > It's worth noting that actually performing a `file-exists-p` check here > would have the added benefit of handling the awkward state between Git > 2.25 (where sparse-checkout was introduced) and 2.35 (where git-ls-files > learned --sparse) where ls-files could still report things that _look_ > like files but are not present. This would be fixed by just replacing > the (eq ..) form with (not (file-exists-p file)). 'file-exists-p' does I/O, so it would make processing an order of a magnitude slower. Here's a benchmark you can try: (benchmark-run 1 (project-files (project-current))) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 21:20:17 2024 Received: (at 73320-done) by debbugs.gnu.org; 29 Sep 2024 01:20:18 +0000 Received: from localhost ([127.0.0.1]:58807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suibh-0003hi-Jl for submit@debbugs.gnu.org; Sat, 28 Sep 2024 21:20:17 -0400 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]:33311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suibf-0003hP-9X for 73320-done@debbugs.gnu.org; Sat, 28 Sep 2024 21:20:16 -0400 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3CA3211401B4; Sat, 28 Sep 2024 21:19:39 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Sat, 28 Sep 2024 21:19:39 -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=fm1; t=1727572779; x=1727659179; bh=7lmTpsOUzso3YDBa71+xFf+R5rSMpzvLTLCRGJ9RsNM=; b= mIOiAM71yhia4fCdIzmSHuBMBnNkTiJEvoUVx+MDiUNW+4GeDmXYreBy1g9jODV7 1cGFTCECVYr4gPifVzDketEBdI1/HVKBESd30AsYiR0vyCWT/JdSK0bPqTwkfD8d vWAPAskahg+CBGhnrAL0NWNOq0JRzzUb5gwOFZnmMlWNFNNu5nWhghtwDmw0HVlt 2d6nEVXG6BOztfbwVkKRT1AzYMPUQROcHffYU8OUX6TINZ711UsQ6DZ6tZcMTWcG +L2q/qvEAZKYcj/p1hUH6uZLEhbuNejfXKw9qZZoqD0kJSPp0YCZsVFAATYhEn/P u9fViX42odEUJWibdY3fdw== 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=fm2; t=1727572779; x= 1727659179; bh=7lmTpsOUzso3YDBa71+xFf+R5rSMpzvLTLCRGJ9RsNM=; b=C L6/1E4P8mAURY6l5Fg2if4Zb3ilzEPNeY63q9l1m0EpASCuw/z/AcBT/68+1KyJ6 +I8vC3G28SDWLi3F73/mKxu5/kb5/ASEUnSBNkILKTp9sEQDvxIaYN5Eykw/UflG ft5UjpuUHTVOfqmhpm5Pw+PKmiOgoLWQh2aU7gQ+3yXygRvPCVSWSgMlo0buBWlT 8S3FokkqpSafw95d7e+H+E3R/Y0J8xsG+iMPgzGTlLrOFSfZ0eo3yeVSz4GxYdFm NIAcNTWSdPeegzAHUcL48n2KQ5Zcva26e2vwXInkoD2wyhIFdYgqi2my/097TLps SkFv7DGSO5Q7B60YkHc3A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduvddggeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffhvfevfhgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepkeefudefgfejffefvdfhteegveevhfekkeekhffg udfhveejteffhfegueetgefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho pedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrlhhlrhgvugdrshgvrghnse hgmhgrihhlrdgtohhmpdhrtghpthhtohepjeeffedvtddqughonhgvseguvggssghughhs rdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Sep 2024 21:19:37 -0400 (EDT) Message-ID: <9f9606df-9726-4d9d-894b-a4bede9f3cb6@gutov.dev> Date: Sun, 29 Sep 2024 04:19:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index From: Dmitry Gutov To: Sean Allred References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> <96ddaf6a-ffdc-4c1f-9141-ee14b41ebd11@gutov.dev> Content-Language: en-US In-Reply-To: <96ddaf6a-ffdc-4c1f-9141-ee14b41ebd11@gutov.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320-done Cc: 73320-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Sean, So I've pushed a slightly tweaked version of your last patch (without the 'cond') to master, commit 8d9a4647fbc, it seems to handle all of the requirements discussed. Please test it out when you have the time, and of course any further suggestions and improvements are welcome. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 03 19:57:39 2024 Received: (at 73320) by debbugs.gnu.org; 3 Oct 2024 23:57:39 +0000 Received: from localhost ([127.0.0.1]:34102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swVhS-0004Uh-KZ for submit@debbugs.gnu.org; Thu, 03 Oct 2024 19:57:39 -0400 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]:50245) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swVhP-0004UQ-GO for 73320@debbugs.gnu.org; Thu, 03 Oct 2024 19:57:36 -0400 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 8031F1380215; Thu, 3 Oct 2024 19:57:27 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 03 Oct 2024 19:57:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc: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=fm1; t=1727999847; x=1728086247; bh=tcIa6zRm/i yvStJZ1MB66jw/+Ltum55Li/4kMwB/3UA=; b=nUQAtjIdNJ7OlQLiD3ouOOCFZj 355I3VdrTF2O/fuKJ7SxneQ1LFqMAasA0UY7fQjHMj9waovm+20rMzPQ7b7ajiqd TdQGn6mJ4ObzyBZ5k5gCsdf2TDw4wh2xM9T1lBWV3JM9CAbldD4g2+97/vimAqFA czucj50yBQoTEXzLJYnyZEcmFmVQL3QPbcJLzWoT1rtIGbU8WcvEsD8wCkDzO4Gs HkpZkPzn7pKS3WGOjyPFParhBcq6tzizL7HeC7vEOF2vKNwEOhJdq3Fb2FrQ3ElM sR03l2xHznEvAUC3iEttFL1WcxG6m9G4Sg7w4qRuOnnH1uyc0R5Vu7E7vMGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= fm2; t=1727999847; x=1728086247; bh=tcIa6zRm/iyvStJZ1MB66jw/+Ltu m55Li/4kMwB/3UA=; b=adBuPpCdFX1+GPI/rJ34oYBswiC0FRYTW9eowQ2AO79K nv8HwQVdZvZNAK2cY+eaSDa1sADodb1RcfIYn6oZDTpkMUGw5P58TNsOtaZikho7 z0Jg/BuZi7zwckexdy/hQUNMFZDxAUEzELMtmr1kDCZGRawpjVRBFkQp1ZtPAS0j tg55gQGCQeR2tTxjCVzlQopaRUDZrznE/sXccYIeYD0uAL0u6wWuu/vasmDjs+Eb x5/rAFyI1pr1uBsw4qwUlnhLU0VwghaSst7AUnfVsNWONcSg3vSjlHIVViBpRCq4 bFxCRX/N1vhzRplqkP089Usk3648tKH6z7QlcGbQIQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvvddgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg hvqeenucggtffrrghtthgvrhhnpeevjeetgeduleeihedvveefuedujeehjeffueegteet gfeiiedvledtgeefffffteenucffohhmrghinheprhgvphholhhoghihrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmihhtrhih sehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuth dprhgtphhtthhopegrlhhlrhgvugdrshgvrghnsehgmhgrihhlrdgtohhmpdhrtghpthht ohepmhhitghhrggvlhdrrghlsghinhhushesghhmgidruggvpdhrtghpthhtohepjeeffe dvtdesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Oct 2024 19:57:25 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------1E7GUgqKwYzLpPFcp80H8Lqz" Message-ID: <8e00a62b-c531-4593-90c3-55e060c5434f@gutov.dev> Date: Fri, 4 Oct 2024 02:57:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index To: Sean Allred , Michael Albinus References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> Content-Language: en-US From: Dmitry Gutov In-Reply-To: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 Cc: 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------1E7GUgqKwYzLpPFcp80H8Lqz Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/09/2024 07:25, Sean Allred wrote: > awkward state between Git > 2.25 (where sparse-checkout was introduced) and 2.35 (where git-ls-files > learned --sparse) Speaking of versions, I've triggered an error on a remote host (with Tramp) because it had older Git installed. It was running a Trisquel 9.0, which is pretty old, but looking at https://repology.org/project/git/versions it appears even the latest Trisquel (11.0) only uses Git 2.34. Same for Ubuntu 22.04 which it's based on, both officially supported until 2027. The attached makes detected version connection-local, that's step 1 (*). It could use some review, though. There aren't many examples of doing that in Emacs code. Michael, could you take a look? Does this look reasonable? Should :application be 'tramp' or 'vc-git'? Is the 'connection-local-set-profiles' call needed here at all or can be skipped? (*) Step 2 might be to limit the --sparse argument to Emacs 31 and newer. :-/ --------------1E7GUgqKwYzLpPFcp80H8Lqz Content-Type: text/x-patch; charset=UTF-8; name="vc-git--program-version-connection-local.diff" Content-Disposition: attachment; filename="vc-git--program-version-connection-local.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvdmMvdmMtZ2l0LmVsIGIvbGlzcC92Yy92Yy1naXQuZWwKaW5k ZXggMDU0MDA1MjMwNDguLjJhNDA1MzlhZGViIDEwMDY0NAotLS0gYS9saXNwL3ZjL3ZjLWdp dC5lbAorKysgYi9saXNwL3ZjL3ZjLWdpdC5lbApAQCAtMzE1LDIxICszMTUsMzEgQEAgdmMt Z2l0LS1zdGF0ZS1jb2RlCiAKIChkZWZ2YXIgdmMtZ2l0LS1wcm9ncmFtLXZlcnNpb24gbmls KQogCisoY29ubmVjdGlvbi1sb2NhbC1zZXQtcHJvZmlsZS12YXJpYWJsZXMKKyAndmMtZ2l0 LWNvbm5lY3Rpb24tZGVmYXVsdC1wcm9maWxlCisgJygodmMtZ2l0LS1wcm9ncmFtLXZlcnNp b24gLiBuaWwpKSkKKworKGNvbm5lY3Rpb24tbG9jYWwtc2V0LXByb2ZpbGVzCisgJyg6YXBw bGljYXRpb24gdmMtZ2l0KQorICd2Yy1naXQtY29ubmVjdGlvbi1kZWZhdWx0LXByb2ZpbGUp CisKIChkZWZ1biB2Yy1naXQtLXByb2dyYW0tdmVyc2lvbiAoKQotICAob3IgdmMtZ2l0LS1w cm9ncmFtLXZlcnNpb24KLSAgICAgIChsZXQgKCh2ZXJzaW9uLXN0cmluZwotICAgICAgICAg ICAgICh2Yy1naXQtLXJ1bi1jb21tYW5kLXN0cmluZyBuaWwgInZlcnNpb24iKSkpCi0gICAg ICAgIChzZXRxIHZjLWdpdC0tcHJvZ3JhbS12ZXJzaW9uCi0gICAgICAgICAgICAgIChpZiAo YW5kIHZlcnNpb24tc3RyaW5nCi0gICAgICAgICAgICAgICAgICAgICAgIDs7IFNvbWUgR2l0 IHZlcnNpb25zIGFwcGVuZCBhZGRpdGlvbmFsIHN0cmluZ3MKLSAgICAgICAgICAgICAgICAg ICAgICAgOzsgdG8gdGhlIG51bWVyaWNhbCB2ZXJzaW9uIHN0cmluZy4gRS5nLiwgR2l0Ci0g ICAgICAgICAgICAgICAgICAgICAgIDs7IGZvciBXaW5kb3dzIGFwcGVuZHMgIi53aW5kb3dz Lk4iLCB3aGlsZSBHaXQKLSAgICAgICAgICAgICAgICAgICAgICAgOzsgZm9yIE1hYyBhcHBl bmRzICIgKEFwcGxlIEdpdC1OKSIuIENhcHR1cmUKLSAgICAgICAgICAgICAgICAgICAgICAg OzsgbnVtZXJpY2FsIHZlcnNpb24gYW5kIGlnbm9yZSB0aGUgcmVzdC4KLSAgICAgICAgICAg ICAgICAgICAgICAgKHN0cmluZy1tYXRjaCAiZ2l0IHZlcnNpb24gXFwoWzAtOV1bMC05Ll0r XFwpIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnNpb24tc3Ry aW5nKSkKLSAgICAgICAgICAgICAgICAgIChzdHJpbmctdHJpbS1yaWdodCAobWF0Y2gtc3Ry aW5nIDEgdmVyc2lvbi1zdHJpbmcpICJcXC4iKQotICAgICAgICAgICAgICAgICIwIikpKSkp CisgICh3aXRoLWNvbm5lY3Rpb24tbG9jYWwtdmFyaWFibGVzCisgICAob3IgdmMtZ2l0LS1w cm9ncmFtLXZlcnNpb24KKyAgICAgICAobGV0ICgodmVyc2lvbi1zdHJpbmcKKyAgICAgICAg ICAgICAgKHZjLWdpdC0tcnVuLWNvbW1hbmQtc3RyaW5nIG5pbCAidmVyc2lvbiIpKSkKKyAg ICAgICAgIChzZXRxLWNvbm5lY3Rpb24tbG9jYWwKKyAgICAgICAgICB2Yy1naXQtLXByb2dy YW0tdmVyc2lvbgorICAgICAgICAgIChpZiAoYW5kIHZlcnNpb24tc3RyaW5nCisgICAgICAg ICAgICAgICAgICAgOzsgU29tZSBHaXQgdmVyc2lvbnMgYXBwZW5kIGFkZGl0aW9uYWwgc3Ry aW5ncworICAgICAgICAgICAgICAgICAgIDs7IHRvIHRoZSBudW1lcmljYWwgdmVyc2lvbiBz dHJpbmcuIEUuZy4sIEdpdAorICAgICAgICAgICAgICAgICAgIDs7IGZvciBXaW5kb3dzIGFw cGVuZHMgIi53aW5kb3dzLk4iLCB3aGlsZSBHaXQKKyAgICAgICAgICAgICAgICAgICA7OyBm b3IgTWFjIGFwcGVuZHMgIiAoQXBwbGUgR2l0LU4pIi4gQ2FwdHVyZQorICAgICAgICAgICAg ICAgICAgIDs7IG51bWVyaWNhbCB2ZXJzaW9uIGFuZCBpZ25vcmUgdGhlIHJlc3QuCisgICAg ICAgICAgICAgICAgICAgKHN0cmluZy1tYXRjaCAiZ2l0IHZlcnNpb24gXFwoWzAtOV1bMC05 Ll0rXFwpIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmVyc2lvbi1zdHJp bmcpKQorICAgICAgICAgICAgICAoc3RyaW5nLXRyaW0tcmlnaHQgKG1hdGNoLXN0cmluZyAx IHZlcnNpb24tc3RyaW5nKSAiXFwuIikKKyAgICAgICAgICAgICIwIikpKSkpKQogCiAoZGVm dW4gdmMtZ2l0LS1naXQtcGF0aCAoJm9wdGlvbmFsIHBhdGgpCiAgICJSZXNvbHZlIC5naXQv UEFUSCBmb3IgdGhlIGN1cnJlbnQgd29ya2luZyB0cmVlLgo= --------------1E7GUgqKwYzLpPFcp80H8Lqz-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 04 03:49:15 2024 Received: (at 73320) by debbugs.gnu.org; 4 Oct 2024 07:49:15 +0000 Received: from localhost ([127.0.0.1]:34331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swd3r-0004O9-8M for submit@debbugs.gnu.org; Fri, 04 Oct 2024 03:49:15 -0400 Received: from mout.gmx.net ([212.227.17.21]:59105) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swd3o-0004Ns-Qr for 73320@debbugs.gnu.org; Fri, 04 Oct 2024 03:49:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1728028138; x=1728632938; i=michael.albinus@gmx.de; bh=Kbxysy5bmgtn67Z5xQSyTP3a9lBFBqsrN+Gbma9YjIw=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=QY5+Zp3qNoPEL6fsunH+AJFgkK26SyjPIR1rm6TO24PAqCDTmm43uJlvDyqMu4OZ +1CGiselToPePJG1yXH9FQmIP5PcDZz31PExywmL3pOaoK6jqJV++0FsxlkxsbLet Fn4g52a+kjonbXzFqh7Ta/rHwVQzvnJ9I56knkzsR6CqtUI35f9bVxwh7ifHmkQoY u8AGCdm/I5CP8cZV9+5bslGLjnQCxkPX1kWz8ZqlqEPX1V3gsD4KUNkHG+aVafBW9 4Osab1VG+wo1P7iWUgZx2fEdA9SacSuPZOr6Fm/fSMTDErTSS/jEntO1LjS8j7gh3 vca93Tzg0N1gelGNNw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.38.155]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Ml6qC-1sBDPS03q8-00pfk9; Fri, 04 Oct 2024 09:48:58 +0200 From: Michael Albinus To: Dmitry Gutov Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index In-Reply-To: <8e00a62b-c531-4593-90c3-55e060c5434f@gutov.dev> (Dmitry Gutov's message of "Fri, 4 Oct 2024 02:57:22 +0300") References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> <8e00a62b-c531-4593-90c3-55e060c5434f@gutov.dev> Date: Fri, 04 Oct 2024 09:48:53 +0200 Message-ID: <878qv471ga.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:jMdq+3+4qZlaXgEUHICWPsVXBliWrv6/0Y83eZnjzJky9yG3T9k tWoItGenCDjBDC6TMenbj5D08OPnSRp4NqV+iiI6eYZY4a1aBbM5whEoxd0kEroP8l4RZmt m5kFZmposJZ1wPMBhoKvjvz9k8MVkpR41gYLa8wapjy8yc5CFoE6D3Iy++G8rYiE0rmXs30 mY3N5Wfe2EFaPmJT/SkXg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:2sI/jIMlLsU=;nfaIXJGeIMJaTXV+jAvv1qia3fi Pvd2gXmH5PCUJBfDyaV8pvHIX+Lpn/ApbY6NsPpcN0bUKPRHWdgs7kSHt95N/E/urWyOJiOyz A8eXVUVK4HDL2cMDL21AtRpJuhLD1mdtLjDwEodkchcCjy4cmI1PxVXv4OvZyCiUDbf/BkqDT 32s/Np9riyFSZSBg/opnIGx7hzAtts325fyc9v+Sb4aCkQfk5sVvLJLkEjUvqgbzG9g49xv+3 sic8IK1NhDdH2l5AUsmDI72JJyuy2af264qaa9AkVaDvfhSIIiudno23xMSWBSWoPmfDWxYqN rJvp1S0iZf/lh75WLpk88iJDHbAzwsi7/qFPoUWiIM9koHrgXD3o5sbIHSFkjVEmuWc3LnXHQ ecjY1bl5qmr6pqZFRjGrh7Gka4I9jHxLk8YGtqjMzSkMiTg75rR38zllqbUDrvXEcL2b56GS7 NXjEIp4qjJaeCBD5NqS7xukKaF9AKK/hf+wmt44xj3p11tG+sXK6oFZOUS2fFkf+OtNZSZ3B6 FuR4YZ+tZT3RLznp5DgZ32yczRvrmlixhny0hExTpDrQ7EK8dmTrru3q+dRxK12SB/ib1bDNr Oi9wwwdQ73DHuDplwt+Q50VAGDmJapfpwxZlVcIHZ09VlrZgeKk51DApycS6nWu/VSYQmtZ9R /T6sbSBEjOw5y4wbU8s0L2cXT8wmSFGEpMzmF6ltFnVogVelOOdACZeIIvA9/KQuOoOGdEsSN hnIfRER81HnzqKZ2toOCUCMMCCMhR7o+RZd8M1YmnxpmBOZDGVuQLke2h2S7XBQKi6yPdUn0X EL70VQfFibtk+rkxN/6c5QWA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 Cc: Sean Allred , 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Dmitry Gutov writes: Hi Dmitry, > It could use some review, though. There aren't many examples of doing > that in Emacs code. In Eshell, Jim Porter makes extensive use of connection-local variables. He has also added some functions which are useful (not applied in Tramp yet). > Michael, could you take a look? Does this look reasonable? Should > :application be 'tramp' or 'vc-git'? In general, it doesn't matter. But since your change is dedicated to vc-git, using the application `vc-git' makes sense. However, you use with-connection-local-variables, which uses the application `tramp' by default. Either use with-connection-local-application-variables instead, or let-bind connection-local-default-application to `vc-git'. I'm not sure how setq-connection-local behaves wrt to the application (this function was written by Jim, I've never used it). But binding connection-local-default-application should be good enough, I believe. > Is the 'connection-local-set-profiles' call needed here at all or can > be skipped? It is needed. connection-local-set-profile-variables declares only the variables, connection-local-set-profiles activates them. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 04 17:25:29 2024 Received: (at 73320) by debbugs.gnu.org; 4 Oct 2024 21:25:29 +0000 Received: from localhost ([127.0.0.1]:36713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swpnl-0006M2-9Q for submit@debbugs.gnu.org; Fri, 04 Oct 2024 17:25:29 -0400 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]:42247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swpnk-0006Ln-1m for 73320@debbugs.gnu.org; Fri, 04 Oct 2024 17:25:28 -0400 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.phl.internal (Postfix) with ESMTP id 71AEE13802C9; Fri, 4 Oct 2024 17:25:18 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Fri, 04 Oct 2024 17:25:18 -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=fm1; t=1728077118; x=1728163518; bh=DgGokpo/cfIpzoB2aJEG8AKQvqnSA2RQKndEX5pw2JM=; b= kQd2OgitZKn+6k1J2nlpfUb2nCJBsMYun+hYGXpKCKnn2lgFUALvTGLn/8/OphrD K86n+xheYbSQPebAmwWfVIJi4gNF0tXNb6ohA2yvgJuRqslc0O+Bp1O2qwQmxAl+ DrmDDZX1xTvGyhIGi4GCVhTMtyjIITaXeZ2oVn1jCTJQ4vnTxLIsR8CRGE7LMVKr 9XNc/zhqF+vktyNICHfXgO8rxQD72z/sg7u0nqXfsm4XzNTqmgZ1HAMJFuglz3SJ ucMkToucwIclDocgWYqHbNvfXDqzGvrE5yVE0gCe+9JE2QaF5DFv2NNbKvFL7/n+ ruXWyZkQdAYxWCavKBSGrg== 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=fm2; t=1728077118; x= 1728163518; bh=DgGokpo/cfIpzoB2aJEG8AKQvqnSA2RQKndEX5pw2JM=; b=O QepfeFjZdZ0XW/nLxd2ZP5sspEu0x00MRNJxBhON3m8A5Soq6cBx3UyFkWwAdVu0 mj9DBB5aF1GLDJIAhND5pbAp3yHG9OKxzQXLrgzLXcD5xT3GwFYOf4wekjzMoao1 CnqTRNNJnuJtcpP6CfJQV13hisBGB1o71PQP14ikw+T5xCfb5Uo8oDT2cCm1JPOZ 79lAz4OkmBnGUkT5rScfSei0PkrrqCj1PwUR2mIV5QISxihtfBQhlT2KjCmahZHZ 9jCLqyPvqF+qAjDQ1So0t/yaPKJBRIT+V75lor77RXOfO3+BiWckRX8ViKFPsxt9 kofOG4pys3hpxGm+QNNNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvfedgudeitdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddv jeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrd guvghvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeu fedtvddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthht ohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepmhhitghhrggvlhdrrghlsg hinhhushesghhmgidruggvpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghp thhtoheprghllhhrvggurdhsvggrnhesghhmrghilhdrtghomhdprhgtphhtthhopeejfe efvddtseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 4 Oct 2024 17:25:16 -0400 (EDT) Message-ID: Date: Sat, 5 Oct 2024 00:25:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index To: Michael Albinus , Eli Zaretskii References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> <8e00a62b-c531-4593-90c3-55e060c5434f@gutov.dev> <878qv471ga.fsf@gmx.de> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <878qv471ga.fsf@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 Cc: Sean Allred , 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Michael, Eli, On 04/10/2024 10:48, Michael Albinus wrote: >> It could use some review, though. There aren't many examples of doing >> that in Emacs code. > In Eshell, Jim Porter makes extensive use of connection-local > variables. He has also added some functions which are useful (not > applied in Tramp yet). Yep, Eshell seems to be have been the only other client of connection-local, until now. I was wondering whether setting a unique application name is the recommended pattern, though. > However, you use with-connection-local-variables, which uses the > application `tramp' by default. Either use > with-connection-local-application-variables instead, or let-bind > connection-local-default-application to `vc-git'. > > I'm not sure how setq-connection-local behaves wrt to the application > (this function was written by Jim, I've never used it). But binding > connection-local-default-application should be good enough, I believe. > >> Is the 'connection-local-set-profiles' call needed here at all or can >> be skipped? > It is needed. connection-local-set-profile-variables declares only the > variables, connection-local-set-profiles activates them. Thanks, Michael. Binding connection-local-default-application seems like a good approach for Emacs 27-28, but vc-git is not distributed separately, so might as well use the newer macro. Here's the updated patch. Eli, any chance this can go in Emacs 30? Could be considered a bugfix, since we're fixing Git version detection on remote hosts. Not a regression, though. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 05400523048..5a7ffeffc9d 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -315,11 +315,21 @@ vc-git--state-code (defvar vc-git--program-version nil) +(connection-local-set-profile-variables + 'vc-git-connection-default-profile + '((vc-git--program-version . nil))) + +(connection-local-set-profiles + '(:application vc-git) + 'vc-git-connection-default-profile) + (defun vc-git--program-version () - (or vc-git--program-version - (let ((version-string - (vc-git--run-command-string nil "version"))) - (setq vc-git--program-version + (with-connection-local-application-variables 'vc-git + (or vc-git--program-version + (let ((version-string + (vc-git--run-command-string nil "version"))) + (setq-connection-local + vc-git--program-version (if (and version-string ;; Some Git versions append additional strings ;; to the numerical version string. E.g., Git @@ -329,7 +339,7 @@ vc-git--program-version (string-match "git version \\([0-9][0-9.]+\\)" version-string)) (string-trim-right (match-string 1 version-string) "\\.") - "0"))))) + "0")))))) (defun vc-git--git-path (&optional path) "Resolve .git/PATH for the current working tree. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 02:49:20 2024 Received: (at 73320) by debbugs.gnu.org; 5 Oct 2024 06:49:21 +0000 Received: from localhost ([127.0.0.1]:37149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swybQ-00029n-KA for submit@debbugs.gnu.org; Sat, 05 Oct 2024 02:49:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swybO-00029U-Ct for 73320@debbugs.gnu.org; Sat, 05 Oct 2024 02:49:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swybD-0004k5-RJ; Sat, 05 Oct 2024 02:49:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nk4KrgUBRGziSKrFbSuDVuNgGlYw2fUteBa2FzD84CI=; b=HWFDGdNCQd/S 4ezSMbelXswHx4bBCH9dAlotsdRDFdGmnSSsZ796q5YcVTYXDb2v6jBV9vyhhxeg9/UXdCYjpDNc7 S8zD88kLlpwPcFABgh1z+XDR4KvCVIcvdK5tdQ6mSUyEgtxt6fH02E0ve75tyVHSQJfzBu+kAqxZb AY79ATCWVdjeCfcjBm6RCfb3ykDampw4QyzngZknfb8b7oE/HqzDTp2ChYPiRzVev+0GxLO1/NQx8 AlfomgE9A4LySXRRHFwYa98iUA9mhuTr2EWc+diJbc681sDmZizq4cdVhfz4WgLsWpJeDVs/QcMhX r5ebh0pBVV3szr6/Y+WJ7g==; Date: Sat, 05 Oct 2024 09:48:41 +0300 Message-Id: <865xq7xcxi.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: (message from Dmitry Gutov on Sat, 5 Oct 2024 00:25:13 +0300) Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> <8e00a62b-c531-4593-90c3-55e060c5434f@gutov.dev> <878qv471ga.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73320 Cc: 73320@debbugs.gnu.org, allred.sean@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 5 Oct 2024 00:25:13 +0300 > Cc: Sean Allred , 73320@debbugs.gnu.org > From: Dmitry Gutov > > >> Is the 'connection-local-set-profiles' call needed here at all or can > >> be skipped? > > It is needed. connection-local-set-profile-variables declares only the > > variables, connection-local-set-profiles activates them. > > Thanks, Michael. Binding connection-local-default-application seems like > a good approach for Emacs 27-28, but vc-git is not distributed > separately, so might as well use the newer macro. > > Here's the updated patch. > > Eli, any chance this can go in Emacs 30? Could be considered a bugfix, > since we're fixing Git version detection on remote hosts. Not a > regression, though. Given that we don't yet have a good understanding of this mechanism and its implications, I'd prefer to install this on master. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 08:33:43 2024 Received: (at 73320) by debbugs.gnu.org; 5 Oct 2024 12:33:43 +0000 Received: from localhost ([127.0.0.1]:37441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx3yg-0004TY-TM for submit@debbugs.gnu.org; Sat, 05 Oct 2024 08:33:43 -0400 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]:60093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx3ye-0004TH-Dt for 73320@debbugs.gnu.org; Sat, 05 Oct 2024 08:33:41 -0400 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id 84B7D1380A05; Sat, 5 Oct 2024 08:33:30 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Sat, 05 Oct 2024 08:33:30 -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=fm1; t=1728131610; x=1728218010; bh=cVa20myyl/v5i8iw5CfRWQRflw6MLlm+coSNBaQWTZg=; b= TdQVBJumgjdpELEtip5Svwet1ByKvM1BJqr078vRXvb3y6+eDXkfeE1mGfXj9ULK Xox2I1YD0rBuwLtpjhikk/KGgVAslvjNhZel5f4fWM+HTGHsx5NwR76Ffnw2l6Jo RArdUQogd9fMaLDTXX+U75sFplfRjls+hL0KtgAdYCOT/03/CfseZd8j/Qr/o9A0 N77a9r9qQfIDXI4USsm+Dh/AGiz9NTZTApEG0p+/5Cw/NxH2cpk70nEwkR0Z6Fsr +XqQ1tM4/PzlpqzpCmxKJ8Dj+U2Nq1TOqayvCf/bqxX6qncnpcNyhHoW/yTP03+M o28Gsd733Yb24pICmoBKfw== 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=fm2; t=1728131610; x= 1728218010; bh=cVa20myyl/v5i8iw5CfRWQRflw6MLlm+coSNBaQWTZg=; b=b P5KiH7/rH3Ap5lzXX2faSsYM5TKv7MbMvrXmozdcMZKqdKmepWjnojqHUdyMEr8s ZcorSXnbX9n21zIyRnHkL/RKrDjxxUBsVp5f7lmDTuphO4ksqIIpw/sypwqNHrvv ZsLADrvSuxUa/XjmJjizbbeFMaFi36Zhycu4897K44D9wlYWoQTZ+u1DjeSD7oua ZS0sFm/bnLl/IDLvjxwmiNUUbal7kO8rEAOquSB51ODSeRUFd6VxCK6+mhb+n7GF 80BKq1ivAY1NertLC4CFfnkRW45YIbgxldcqrwADOj+ku1c13tGPes39BGncxhu1 Jg4v2UBh/1Hbiuwvw9V3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddvhedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieekueef tddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrgh dprhgtphhtthhopehmihgthhgrvghlrdgrlhgsihhnuhhssehgmhigrdguvgdprhgtphht thhopegrlhhlrhgvugdrshgvrghnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepjeeffe dvtdesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 5 Oct 2024 08:33:28 -0400 (EDT) Message-ID: Date: Sat, 5 Oct 2024 15:33:27 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index To: Eli Zaretskii References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> <8e00a62b-c531-4593-90c3-55e060c5434f@gutov.dev> <878qv471ga.fsf@gmx.de> <865xq7xcxi.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <865xq7xcxi.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 Cc: 73320@debbugs.gnu.org, allred.sean@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 05/10/2024 09:48, Eli Zaretskii wrote: >> Date: Sat, 5 Oct 2024 00:25:13 +0300 >> Cc: Sean Allred,73320@debbugs.gnu.org >> From: Dmitry Gutov >> >>>> Is the 'connection-local-set-profiles' call needed here at all or can >>>> be skipped? >>> It is needed. connection-local-set-profile-variables declares only the >>> variables, connection-local-set-profiles activates them. >> Thanks, Michael. Binding connection-local-default-application seems like >> a good approach for Emacs 27-28, but vc-git is not distributed >> separately, so might as well use the newer macro. >> >> Here's the updated patch. >> >> Eli, any chance this can go in Emacs 30? Could be considered a bugfix, >> since we're fixing Git version detection on remote hosts. Not a >> regression, though. > Given that we don't yet have a good understanding of this mechanism > and its implications, I'd prefer to install this on master. Okay, then we might only support --sparse with Emacs 31. Otherwise, a user could upgrade project.el from ELPA and have that in Emacs 30 too. with-connection-local-application-variables had been added in Emacs 29.1, BTW. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 06 20:42:22 2024 Received: (at 73320) by debbugs.gnu.org; 7 Oct 2024 00:42:22 +0000 Received: from localhost ([127.0.0.1]:43510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxbpO-0004ky-9x for submit@debbugs.gnu.org; Sun, 06 Oct 2024 20:42:22 -0400 Received: from mail-pf1-f173.google.com ([209.85.210.173]:48480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxbpM-0004kq-GG for 73320@debbugs.gnu.org; Sun, 06 Oct 2024 20:42:21 -0400 Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-71e06ba441cso81008b3a.1 for <73320@debbugs.gnu.org>; Sun, 06 Oct 2024 17:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728261673; x=1728866473; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=EBw3EOjOV3kU4AigPvh+sa+TBNe0UxIj5VEy4Ue8Ghw=; b=W//RdbituQbuR0mjrSJ/r2FSDdaxNMSf7oTuhcJ/sjiqxb8CcOVMzShPBZFw/YD47z nGd2KwYCBOVJU4fh4+fukLdrL75pQXR0fqTcYeVUIOcVdeXEb4NT9ocjDZmhu4MENbad JJmeRblquIkZaD9qSvccGHDwnOVE9V96dfCQ40Y2MOhJv7JW7zoU7WF4Lj1OVzixvVBA u3o0e7z8u7csKRD3niSsFXST2gdxy6s21byA2U/Pk60F9U10EUTdIpRGLRw0e7kWGc7V eehi+OxsaF4jWYDOLttRLkriv4lBLrR9xatl+zeHnxgDn2TjwBGdpBTlRhgSsgX0648q bmLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728261673; x=1728866473; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EBw3EOjOV3kU4AigPvh+sa+TBNe0UxIj5VEy4Ue8Ghw=; b=CNR7C/p1Tfw2Ah1kqQKhcnNXW7nKl00i7I/ltwshNEb52nLEiStvQu1wIGf2uRbDqB 1ybkrIt3+hJ6Dxh8EmoXZH5SGNbcEfIuzmK2p4PKjrJuRpi0zqNLiUrj8VuwiMCwJkXb wCL7/W1TgYkExiU7V0jC30pWGR2JxkP/70PCaGcFrfPxOIVuHhsR0K7m4KFZoPad2+PC kuNEz53zxw7RAwRWUHuXCjuwUhSEvDga+fxdMfqZULG9aI2+MlWifNvJ6lr2YTawCy4n WUuMYBLuvCnkvuMP3D4vHysqhmyM77MKGBYLKo0kwnxm/dIMvKuSZAi7wGHga9CuQuNZ oA/w== X-Forwarded-Encrypted: i=1; AJvYcCUqE1vIEOs+p7ocnRXlhguH/tweOwDBQftiWGNOmufwINIi7OQcmEUcQW88V2Kj8QlXuIjR9A==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxn440KXaB62RdBXQJyufBWWrhixi5FHdPjiFu2W8/x++UictKM wk42kF0+hj+jwEl5f01JggELsnMgeTrVggEjXnx6F8WFPrn0iXD3 X-Google-Smtp-Source: AGHT+IGwIm7LkxJcCQGNcLSCODbLLHSrt1XupB0wWRxXcwaxXv+OfN8n7tiu44yA5764gPwA51MFeg== X-Received: by 2002:a05:6a20:9f09:b0:1d4:e4eb:73e2 with SMTP id adf61e73a8af0-1d6dfa35f28mr14490971637.13.1728261672924; Sun, 06 Oct 2024 17:41:12 -0700 (PDT) Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id 41be03b00d2f7-7e9f681f089sm3733170a12.25.2024.10.06.17.41.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Oct 2024 17:41:12 -0700 (PDT) Message-ID: <6c852997-44f6-4a84-f03c-2afd1c5704df@gmail.com> Date: Sun, 6 Oct 2024 17:41:11 -0700 MIME-Version: 1.0 Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index Content-Language: en-US To: Dmitry Gutov , Michael Albinus , Eli Zaretskii References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> <8e00a62b-c531-4593-90c3-55e060c5434f@gutov.dev> <878qv471ga.fsf@gmx.de> From: Jim Porter In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 73320 Cc: Sean Allred , 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 10/4/2024 2:25 PM, Dmitry Gutov wrote: > Hi Michael, Eli, > > On 04/10/2024 10:48, Michael Albinus wrote: > >>> It could use some review, though. There aren't many examples of doing >>> that in Emacs code. >> In Eshell, Jim Porter makes extensive use of connection-local >> variables. He has also added some functions which are useful (not >> applied in Tramp yet). > > Yep, Eshell seems to be have been the only other client of > connection-local, until now. I was wondering whether setting a unique > application name is the recommended pattern, though. If I remember things correctly, I think using ":application eshell" was a suggestion from Michael Albinus. (I don't think I'd have come up with the idea on my own, since I didn't know much about connection-local variables at the time.) However, I think can be a good move to use a unique application name when it makes sense because it reduces the chance of conflicts. For example, in a future version of Eshell, I might make 'process-environment' connection-local for ":application eshell" (it's a long story). This would let users change remote env vars in Eshell freely without interfering with the ":application tramp" remote env vars, which would get used in other cases (e.g. when opening a remote file or using M-x shell remotely). From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 07 19:38:47 2024 Received: (at 73320) by debbugs.gnu.org; 7 Oct 2024 23:38:48 +0000 Received: from localhost ([127.0.0.1]:49430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxxJP-0004N9-I5 for submit@debbugs.gnu.org; Mon, 07 Oct 2024 19:38:47 -0400 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]:49629) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxxJN-0004Mt-P2 for 73320@debbugs.gnu.org; Mon, 07 Oct 2024 19:38:46 -0400 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id B65B113801DD; Mon, 7 Oct 2024 19:38:32 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Mon, 07 Oct 2024 19:38:32 -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=fm1; t=1728344312; x=1728430712; bh=LWoq/O9GOpMhyO/nF0APQ/jkowKupvjkp0rX9xKuPG0=; b= UXO0X6txhM2b8n8MwxwzNp5un8q+N6frlhzQdso0iXqNhjIWeNcAxoL0VQxOjEQA U18ss7VjB56r0uxQQ0YzEEdokFQ58rSwyRYU/UMmqIFv8uoeS7adSjaDTVG0ETdU of2d4OZf1JXLigmYa7NP5jHhY2eUMuEkvuEof8v1966hds9F7TB/xBfLsHV7cWkG 1dLNePuLn72+pRvbaYl2bzIBysb8MykEMDm+UiotndCZ0A+mAydJgw87wTz5bYlz Wx0kiibq+ZefwOovGAiJ/kuHbtIkvekSGp/6QE7IAW4ja/AEl+ZnarO+CZJwkvRz Mr0+Q3/uU/ddv3MRIVMA5g== 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=fm2; t=1728344312; x= 1728430712; bh=LWoq/O9GOpMhyO/nF0APQ/jkowKupvjkp0rX9xKuPG0=; b=j tUAyzMzynUJdhKjnlnkG6D9wZYCsM5jwtUV1IE03LuvI8bxKOIdGg55dOn+xeGEr Qxu2ZTppfiw3wya1WjPDFoSzRWAtx44LcoWHiTsltRnJSlEZhaTB8qJNnp8IcMBx d7sMzlLMLy6XQrkST45+czOm3nHkd9Xzn8dmFwDDXDs6NQ8v0hVHPc9duJwdfNaC s0yBpSY4xxUWHrCmyVMGAC/VKdqDWmiDf5e4gDgUwT2M65dNvBNT/9aW0iKziYZH Dg6GiH67iJLKXr1quhcJpUpONKkQTNcBvfwOwlsLWMwbANGQOT4Ca6eRFLJQ7DWm 7cUCMatlGUfA9110lz7rQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeftddgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepteduleejgeehtefgheegjeekueehvdevieekueef tddvtdevfefhvdevgedujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjphhorhhtvghrsghughhsse hgmhgrihhlrdgtohhmpdhrtghpthhtohepmhhitghhrggvlhdrrghlsghinhhushesghhm gidruggvpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtoheprghllh hrvggurdhsvggrnhesghhmrghilhdrtghomhdprhgtphhtthhopeejfeefvddtseguvggs sghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Oct 2024 19:38:27 -0400 (EDT) Message-ID: <817fd987-f83f-442c-9f38-ef764f84eee4@gutov.dev> Date: Tue, 8 Oct 2024 02:38:25 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index To: Jim Porter , Michael Albinus , Eli Zaretskii References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> <8e00a62b-c531-4593-90c3-55e060c5434f@gutov.dev> <878qv471ga.fsf@gmx.de> <6c852997-44f6-4a84-f03c-2afd1c5704df@gmail.com> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <6c852997-44f6-4a84-f03c-2afd1c5704df@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 Cc: Sean Allred , 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 07/10/2024 03:41, Jim Porter wrote: > On 10/4/2024 2:25 PM, Dmitry Gutov wrote: >> Hi Michael, Eli, >> >> On 04/10/2024 10:48, Michael Albinus wrote: >> >>>> It could use some review, though. There aren't many examples of doing >>>> that in Emacs code. >>> In Eshell, Jim Porter makes extensive use of connection-local >>> variables. He has also added some functions which are useful (not >>> applied in Tramp yet). >> >> Yep, Eshell seems to be have been the only other client of connection- >> local, until now. I was wondering whether setting a unique application >> name is the recommended pattern, though. > > If I remember things correctly, I think using ":application eshell" was > a suggestion from Michael Albinus. (I don't think I'd have come up with > the idea on my own, since I didn't know much about connection-local > variables at the time.) > > However, I think can be a good move to use a unique application name > when it makes sense because it reduces the chance of conflicts. For > example, in a future version of Eshell, I might make 'process- > environment' connection-local for ":application eshell" (it's a long > story). This would let users change remote env vars in Eshell freely > without interfering with the ":application tramp" remote env vars, which > would get used in other cases (e.g. when opening a remote file or using > M-x shell remotely). Thanks, makes sense. Seems particularly useful for users who'd want to fine-tune the sets for one "application" independent from the other. The var in vc-git is less of a user-facing thing (it still uses "--" in its name), so I was wondering what's the default solution that we recommend. Seems like it is to assign an application anyway. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 07 19:56:19 2024 Received: (at 73320) by debbugs.gnu.org; 7 Oct 2024 23:56:19 +0000 Received: from localhost ([127.0.0.1]:49474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxxaN-0005KE-Cc for submit@debbugs.gnu.org; Mon, 07 Oct 2024 19:56:19 -0400 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]:52857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxxaL-0005K0-Lz for 73320@debbugs.gnu.org; Mon, 07 Oct 2024 19:56:18 -0400 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id 81DF01140231; Mon, 7 Oct 2024 19:56:04 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Mon, 07 Oct 2024 19:56:04 -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=fm1; t=1728345364; x=1728431764; bh=q532rlxwaupVk66X3MfbMHMXouggADmSmFFOF81vKtM=; b= c6XD6d+IYqnr92eKxElpZHMEhgWOiszMWVc2KhY1jUYucmabpk3p6VA+BPgvYXKE 0bii/JtpBv0aZ/H1UGmbGRjjXIW0aLh/jYUJqgqErzMcWDL5TMi4rJ6aL7in8su4 6Lqlg5bdd3a1SbZuBCx+6KDGSa3WKySoTgbsloI1XX1f1gCpeAjqfpMKOCgLgKYh nMPYJHj24dUo2xCubt50xDtyMxruRjPWBOAAvrnjTETv5WdtVBlluYPpu2DU6Ov5 4wMa91i4vamOK8ftEmObsGwa9OL2oQhjF22xqnYn6NJ5hG5uGqx3l3JUyTDcu1re 4UnAzFqXeZjH75EWIkh7Fw== 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=fm2; t=1728345364; x= 1728431764; bh=q532rlxwaupVk66X3MfbMHMXouggADmSmFFOF81vKtM=; b=L o7M1FQI/5IaTXxm3ZcJgxFH4ZTHkToF+/EJIUR5pTh896DyAMbO4wb5KUASCfArB Tl8+Z0Ul+vIoD9Lz69yFP4eU126f6s8PT39GGTR+2icToJGqcwBHBHf32vTJKMAq sPFv455eWvRB7lgVdCR4QNUXIUUZz7y1TamO6E8ZrNMmXhD61AYieRT2x2McVrIr 87I8RcX0bB5deh/PX/z7f4xSA77MXN8EPN1Mu5+v7KSYOQODi6Yxma6IgdEHYc1q JplVKNlnDmJ4gzQuOW4fsdYknMOL46po2nUPPlp7T/2Bc0bMjdQTKaOcQUwnTmTY ll4WoGbDpaoCQq6jbYpjA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeftddgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffhvfevfhgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepkeefudefgfejffefvdfhteegveevhfekkeekhffg udfhveejteffhfegueetgefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrgh dprhgtphhtthhopeejfeefvddtseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthht oheprghllhhrvggurdhsvggrnhesghhmrghilhdrtghomhdprhgtphhtthhopehmihgthh grvghlrdgrlhgsihhnuhhssehgmhigrdguvg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Oct 2024 19:56:01 -0400 (EDT) Message-ID: <129d1fc8-e185-4bf3-a8c9-d58c0998064d@gutov.dev> Date: Tue, 8 Oct 2024 02:55:58 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#73320: [PATCH] project--vc-list-files: use Git's sparse-index From: Dmitry Gutov To: Eli Zaretskii References: <73758f39-1e18-471a-9dfb-0ceade12dacf@gutov.dev> <8e00a62b-c531-4593-90c3-55e060c5434f@gutov.dev> <878qv471ga.fsf@gmx.de> <865xq7xcxi.fsf@gnu.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73320 Cc: michael.albinus@gmx.de, allred.sean@gmail.com, 73320@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 05/10/2024 15:33, Dmitry Gutov wrote: > Okay, then we might only support --sparse with Emacs 31. Otherwise, a > user could upgrade project.el from ELPA and have that in Emacs 30 too. Now pushed to master. From unknown Fri Jun 20 07:21:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 05 Nov 2024 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator