From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: A project-files implementation for Git projects Date: Mon, 23 Sep 2019 15:22:27 +0300 Message-ID: <7386ef98-c151-e1ce-23fa-11470a16f0d3@yandex.ru> 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> <874l13h30l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="254763"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 23 14:32:34 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 1iCNW6-001498-Mb for ged-emacs-devel@m.gmane.org; Mon, 23 Sep 2019 14:32:34 +0200 Original-Received: from localhost ([::1]:55928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCNW5-00080A-60 for ged-emacs-devel@m.gmane.org; Mon, 23 Sep 2019 08:32:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48695) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCNMP-0002Lr-Cz for emacs-devel@gnu.org; Mon, 23 Sep 2019 08:22:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCNMO-0002tP-07 for emacs-devel@gnu.org; Mon, 23 Sep 2019 08:22:33 -0400 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:56180) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iCNMN-0002tD-Q8 for emacs-devel@gnu.org; Mon, 23 Sep 2019 08:22:31 -0400 Original-Received: by mail-wm1-x334.google.com with SMTP id a6so9690304wma.5 for ; Mon, 23 Sep 2019 05:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qgN6lug9o8Mxe0+IjzMKIm4Ed/DjpLZh60zbZ6vZJMg=; b=NQ/n1ObOr13q2/T15mecCFfnHe2AaPAPOOlNO38Q6na9EgwIbkE3MRavEbEdMOcVyA u87QJkStlsmPDdBacDA6BSwdS1jdOJHzEi0+bBn2an5bDHGxyaMz2pITt43GeKICglDc keDDBF98O0qCUlgS80J4nQFJESvjZSTVV2GVIW5HdcAfdFu0Cn4maqb2BRsoYMw2zi8B bnUcqDORDor4/ig8zjqd8//hurApakjNKjx3XXpXr9EMN8hGx8oFFOcSKQY5WlYNCT59 82zSrqfCsdS3CUGHaR6+icZBstWWKjDkifKzMgHQbyPXQjnp4RhtxMKxekO/S485xGoF qHcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qgN6lug9o8Mxe0+IjzMKIm4Ed/DjpLZh60zbZ6vZJMg=; b=H6UQJTYfdSFOTXuKykmyMuNEDWT/XqctfySHXO31hgLoULOfckew9C8vqFqn75RP06 LpAYTIMMQFRRlDC0zlyKMGJNThixI6PPmE0MNqSVrChLMIeMkLtNQ8wIYm2ou6K2iUD8 EMhVs8k81PSJyXZJ1JdKZB5DWZrh0zgSJt248nstbifrmY9pyrgTxTuaBjkm3+qMfAHn RUQf3vrO8WVLXK7n7xm/S9umFY1UOUrJ/RcGweFq/WCFfmuHoWaeTV0Ru4vdx7fzSIpq GjYVQcEYcGJm+ze3XeftYuDjfO2hnbX05mhgOaFo5g7mbjK5E1u156xE98sLmraL68Xo dSew== X-Gm-Message-State: APjAAAU5sSHVPSiMXj/1ppoFka79b+GAM5SH1ET6Ur6uVmO3QTYNWqsW BCKB1ZX9BnZRDIVlE6xZjiaeNq7/oXQ= X-Google-Smtp-Source: APXvYqz99P2sZZSHCBBFMFCqFSJTPWqXEF9/kMOw3CSL/kaQffxetAhtqj6Q30QE1/CbGgGxux7l+g== X-Received: by 2002:a1c:7c15:: with SMTP id x21mr14667073wmc.154.1569241349703; Mon, 23 Sep 2019 05:22:29 -0700 (PDT) Original-Received: from [192.168.0.133] ([109.110.245.170]) by smtp.googlemail.com with ESMTPSA id u11sm10700170wmd.32.2019.09.23.05.22.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Sep 2019 05:22:28 -0700 (PDT) In-Reply-To: <874l13h30l.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 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:240262 Archived-At: On 23.09.2019 10:42, Tassilo Horn wrote: > 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. Thanks! >> 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 I think that was more of a "yes". :-) > 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 What I wondered is whether running 'hg status --all --exclude 'committed.*' would include 'ignored.o' in the output. It does, and still with 'I' at bol. It's a good result, and it probably implies that ALL-IGNORES semantics might be a better choice, in case some people have *lots* of files ignores in their Hg repos (build artefacts, etc). >> 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, a bit later. But it seems obviously doable with Hg: just add all includes with --exclude and avoid filtering by the status character. >> 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? Yes. Just worried about the number of cases where we would use the fallback. >> 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. Excellent. >>> 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'. Makes sense. So it would need a fallback as well. Maybe someday, then.