From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: A project-files implementation for Git projects Date: Mon, 23 Sep 2019 09:42:50 +0200 Message-ID: <874l13h30l.fsf@gnu.org> References: <8736h9rdc4.fsf@gnu.org> <87mufcfz1u.fsf@gnu.org> <87tv9kz2x6.fsf@gnu.org> <87a7bbjdwe.fsf@gnu.org> <87a7ba8uvx.fsf@gnu.org> <87pnk2zvvy.fsf@gnu.org> <87sgows6wy.fsf@gnu.org> <87ef0dy18z.fsf@gnu.org> <87impk675h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="103567"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 23 09:44:26 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iCJ19-000QZy-LG for ged-emacs-devel@m.gmane.org; Mon, 23 Sep 2019 09:44:19 +0200 Original-Received: from localhost ([::1]:53118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCJ17-000229-ST for ged-emacs-devel@m.gmane.org; Mon, 23 Sep 2019 03:44:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39184) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCIzn-00011u-CF for emacs-devel@gnu.org; Mon, 23 Sep 2019 03:42:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iCIzm-0008CR-VL; Mon, 23 Sep 2019 03:42:55 -0400 Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:57189) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1iCIzm-0004St-KG; Mon, 23 Sep 2019 03:42:54 -0400 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 3511D2202A; Mon, 23 Sep 2019 03:42:54 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 23 Sep 2019 03:42:54 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdejgdduvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuffhomhgrihhnpegvlhdrrg htnecukfhppeegiedrkedtrdejtddrvdehnecurfgrrhgrmhepmhgrihhlfhhrohhmpeht hhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekge dqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhmnecu vehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Original-Received: from thinkpad-t440p (p2e504619.dip0.t-ipconnect.de [46.80.70.25]) by mail.messagingengine.com (Postfix) with ESMTPA id C2AEE8005B; Mon, 23 Sep 2019 03:42:52 -0400 (EDT) Mail-Followup-To: Dmitry Gutov , emacs-devel@gnu.org In-Reply-To: (Dmitry Gutov's message of "Sun, 22 Sep 2019 12:37:08 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240257 Archived-At: Dmitry Gutov writes: Hi Dmitry, >> No, it doesn't slow down the listing (in comparison to just hg status >> --all). However, my test hg repo is not extraordinarily large (~4000 >> files). > > If performance is C*N where N is the number of files, then we can > compare the times to complete on any medium-sized repo, as long as the > list of ignores is significant (though they don't need to match > anything). I'll see if I can get some larger repo and report back. With my test repo with ~4000 files, it took around 0.25 seconds no matter if zero or ten --exclude patterns were given. > Anyway, if the perf looks good to you we could push the improvement > first and then deal with negative reports. Yes. >>> BTW, can Hg support extra whitelist entries as well? >> "hg status --all" prints everything including ignored files. An >> --exclude restricts the output and filters the output so that >> matching files are not listed. --include also restricts the output >> so than only files matched by such an include pattern are listed. > > What about the hgignore contents? Does EXTRA-IGNORES in the Hg > implementation actually mean ALL-IGNORES, i.e. will we need to pass > the whole ignores list there? No, "hg status --all" prints files with their status, e.g., $ hg status --all ? unregistered.txt I ignored.o C .hgignore C committed.txt Right now, we don't collect files marked as "I"gnored. As soon as you add extra ignores, files will actually be filtered: $ hg status --all --exclude '*.o' ? unregistered.txt C .hgignore C committed.txt > I've been toying with an implementation for Git which uses negative > pathspecs to specify all ignores (including the whitelist), instead of > modifying the ignores list. Performance-wise, it looks good enough, so > it seems my intuition was wrong. We could hit maximum command line > length this way, though this didn't happen with Emacs's gitignore, > which is not small. I wonder how much of a concern that would be. > > The actual implementation wasn't saved on disk and got eaten by a > reboot, but I can show it later if you like. Sure, then I can check if that's doable with at least hg. >> Ok, I see. So that would be this and it seems like now we have the >> same semantics as with the hg version: > > Very good. Support for rooted entries and whitelist can be easily > added here. > > There's a caveat, though: negative pathspecs have only been added > AFAICT in Git 1.9. Whereas CentOS Stable is on Git 1.8.3 currently. > > So we'll have to handle it somehow, e.g. use a fallback for that > version. IMHO, the fallback is just use the existing "find" version, no? >> A quick look at bzr suggests there's just a way restrict positively, >> i.e., like --include with hg. > > That makes me more inclined to just hardcode two implementations (one > for Git and another for Hg) inside project.el. At least as the first > version of this feature. I have no clear preference but as my main concern is better performance with our Git repo at work, I won't object. >>> Yeah, I wonder if we should treat this as a VC operation. On the >>> other hand, the fallback implementation could just as well use >>> 'find'. >> Right now, it uses `vc-file-tree-walk'... > > Shouldn't somebody reimplement it on top of 'find'? I don't know. It would surely be faster but there might be systems without 'find'. Bye, Tassilo