From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#74243: [PATCH] Speed up vc-hg-state by treating ignored files as unregistered Date: Sun, 17 Nov 2024 09:03:30 +0800 Message-ID: <87mshy7jtp.fsf@melete.silentflame.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30932"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Spencer Baugh To: 74243@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 17 02:04:25 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tCTiC-0007tW-Bb for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Nov 2024 02:04:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCThv-0005eT-1e; Sat, 16 Nov 2024 20:04:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tCThr-0005dy-Q7 for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 20:04:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tCThr-0002ES-HC for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 20:04:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=xbpnpvtnhTthVF/CY+GJQpJ0Uk0XfSQll05aVkkWM84=; b=m2G+CvJoRs+iiW4M+r6bSVyiSiPuukmkA4szg/XU7x1MRkVHPIAND13TnN6omWIdrZtz975R2ttLp4ycIGsKyCLJNuPk8sJrzcBhSXTXHOxVbxZt640su/+ORgNC5PgAoMXDhdDNYXhWAHpvucNxbBk9qNMlnXSgBidU2i9jD7xM7Uw7G9YNw9Dg+/ZTTGTK+IxSzHWFgHNS6j228+vGF7YTrLav4JN1MXOP/7L3lL/14Vb09oVENkLraPgpG6QOXTXHMKV9LVwhIPaSXsyuKeH3dO+kfjr5GwWAnj+1x9Do9/rVOz+zdNylYHk0ouXQDYeErQzlJBxwkG2Ojxh4Cw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCThq-0001Cf-Ap for bug-gnu-emacs@gnu.org; Sat, 16 Nov 2024 20:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Nov 2024 01:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74243 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74243-submit@debbugs.gnu.org id=B74243.17318054274605 (code B ref 74243); Sun, 17 Nov 2024 01:04:02 +0000 Original-Received: (at 74243) by debbugs.gnu.org; 17 Nov 2024 01:03:47 +0000 Original-Received: from localhost ([127.0.0.1]:55267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCThb-0001CC-5L for submit@debbugs.gnu.org; Sat, 16 Nov 2024 20:03:47 -0500 Original-Received: from sendmail.purelymail.com ([34.202.193.197]:52800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCThY-0001Bu-UB for 74243@debbugs.gnu.org; Sat, 16 Nov 2024 20:03:45 -0500 DKIM-Signature: a=rsa-sha256; b=OCM3MmD8ZmbwCsBnBxHoRkQrXBRQtUFArg98JPB/o0G8cbzSrCym3ej5cVz5jzItMFxJb76mJ0AyXahyaSw94PwbP63l/1eFf2CCWmC3g3oruL58c4QeVBuPufv5Zc1gTx1tenRvNLUAbHqOVYpLTslBbi0t6u5WumCOipS5O8JJKU0OhEgQTCven7WN4HlkUR8dYuBVYWnlivpmzDWljGOJfzWDNM4s+5Mh5ZyI7PQcTmTa/7bwwNJjgY/yqcC/Ns+wiYViAGht09IN7pd6+wzqUHIPcdX5YjspKF3WL70sDEQbg591HrcwMfZcsAhxTITEh9xnmSYfmlmoUR7dBg==; s=purelymail2; d=spwhitton.name; v=1; bh=LFhh+3vUUaAGYzDVVfGPVLV1nRTPkgtPp+icjDxWBQ8=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=Noxm/yxNMpstofVTJ/llN6I8LuFFEVKn6ZeDtv72aY7XjU3Yx2k9DwVMOmW81wlrBH4arJOjTewf3RKQNHLSxmvUPQPsJp77q1gTjfFj9HNfkaH/fQtuzK7viH+FxfXlZICa28biCeeTLff7Mga49kPB6WjPdKq0qI1ou/wp6EZK5KHV3YH1M/61FAYH0Eq59V2K7w7KgO5M4KFgOBUvMBRJw3JagbI0USWtpmZCrxyS3KyIrj4L5n1BdtUW/T1FAk5n138MPmOPVNaFXN3BEpko05D/me/aBzAgU5xPED7TnZ3W+nRRsRj62BYKOoAXM1Py64AwYXHN+881nrknCQ==; s=purelymail2; d=purelymail.com; v=1; bh=LFhh+3vUUaAGYzDVVfGPVLV1nRTPkgtPp+icjDxWBQ8=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 74243@debbugs.gnu.org Original-Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -287260901; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 17 Nov 2024 01:03:33 +0000 (UTC) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 498277E42C6; Sun, 17 Nov 2024 09:03:30 +0800 (CST) In-Reply-To: (Spencer Baugh via's message of "Thu, 07 Nov 2024 12:41:47 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295503 Archived-At: Hello, On Thu 07 Nov 2024 at 12:41pm -05, Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote: > The most significant slow component of "hg status" is parsing the > .hgignore file. If we pass -mardc instead of -A to hg status, hg > doesn't list ignored or untracked files, so it skips parsing the > .hgignore. On my large repo, this brings "hg status" from 140ms to > 20ms. Thanks for investigating this. > For vc-hg-state, the distinction doesn't matter: nothing using the > output of vc-hg-state has significantly different behavior for ignored > files vs unregistered files: > - vc-dir-clean-files and vc-dir-recompute-file-state call vc-hg-state, > but will never see an ignored file anyway since vc-dir shouldn't list > ignored files for hg. > - vc-next-action checks 'ignored, but it's OK to take the > 'unregistered path instead; it will either fail when calling hg, or > succeed. > - Other users of vc-state don't differ between 'ignored and > 'unregistered In vc-dir for a git repo, if I type 'G' on an unregistered file and then 'g' to refresh the view, the status label next to the unregistered file changes to "ignored". ISTM this is a nice feature that allows you to confirm that the addition to .gitignore worked. If that doesn't currently work for Hg, someone might want to implement it at some point. vc-state is a public function, so someone might well be relying on it returning 'ignored, for some other purpose. So, can we do this with a new optional argument to vc-state? Like how vc-deduce-fileset can provide more information if STATE-MODEL-ONLY-FILES is non-nil. It could be an optional argument that means to treat 'ignored and 'unregistered the same. Or something similar. It seems well-motivated to add an argument to the general vc-status because it's an operation that can be slow in large repos regardless of the backend. Though we could start by just adding an optional argument to vc-hg-status. Or, less invasive would be a vc-hg--status-internal which does it. -- Sean Whitton