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: Sun, 15 Sep 2019 11:29:12 +0300 Message-ID: <26fed1b0-1e50-2844-f6e6-8c062d8d4bcc@yandex.ru> References: <8736h9rdc4.fsf@gnu.org> <87mufcfz1u.fsf@gnu.org> <87tv9kz2x6.fsf@gnu.org> <87a7bbjdwe.fsf@gnu.org> <87lfuqzv4n.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="10353"; 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 Sun Sep 15 10:32:35 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 1i9PxT-0002Yv-2Y for ged-emacs-devel@m.gmane.org; Sun, 15 Sep 2019 10:32:35 +0200 Original-Received: from localhost ([::1]:53408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i9PxR-0000pn-9e for ged-emacs-devel@m.gmane.org; Sun, 15 Sep 2019 04:32:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53393) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i9PuM-0000LY-Ca for emacs-devel@gnu.org; Sun, 15 Sep 2019 04:29:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i9PuL-0004Y0-72 for emacs-devel@gnu.org; Sun, 15 Sep 2019 04:29:22 -0400 Original-Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]:46986) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i9PuK-0004Xh-Tl for emacs-devel@gnu.org; Sun, 15 Sep 2019 04:29:21 -0400 Original-Received: by mail-lj1-x243.google.com with SMTP id e17so30853311ljf.13 for ; Sun, 15 Sep 2019 01:29:20 -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=c1a/xUplbv1dLHz2cr6nkpO5zS9/UnvrFvEFTfdoFkg=; b=dTxOqvlocITwDLY8XDJ8QTUxt4PFpxqrAmsXb6hIItYWVcb1Ix91KEw1nilrxLFZpo LKPEoQ+TABKXSxTsYx+oCNMwilrvPYuCEHMHB8QF9pxEyG0GiloTAmu2LiTSaG2FoJLu qG4eZsTasLpamkF+Hnq77tR0Gt3wpg6MMSgCCwVp68pT4Dk2VRn3mzXswlmGpPE2Gxg/ ErQhVfvB67/sMThH4vnP1G95+bsw99UGfaZghO7vX1gQP8+jvYvJ34KwuDOqqkuzySWj 9KYwYu1hRds7KGd+K/PeJ9SdB2gTi2wHlDHozwld1GKYklUtRnuQz3p0dah7T1tyzeq9 2DsQ== 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=c1a/xUplbv1dLHz2cr6nkpO5zS9/UnvrFvEFTfdoFkg=; b=FMT1NzFEF+1utlSwEn8+Xi5YDlF0Lho4ubL+SWb/eWlmAI9/b0s2b5ElYFu09plTfi Ljev2rxoYwSh1+nM+F6hjEaxOi1AIxc263MIaCwbY24+OdGWe78wNTl1Ce4tkoPmOQLU z/aUqoVlfWiVQQC1quNvL8cHKsqCkwojt35KHOyFq1WPJHzilGlo2p1+XWGvoEUiuIRE A1ycss2aVPkeqirW2KRbeek0Bxc1y/3tWBJEclrjUkhmwjV7YsjKNMUpqQE7VBR0AgwO 3VOwZBEGvPcPzktNLpHz0sNvhmFoU1WrHB6yimxb2oJjbHLon7ce7131qomZuu8f9H5k DWTA== X-Gm-Message-State: APjAAAU/1kjjJqgoWbA89k14F7kmyti93NkXOw3nxNUFiMS96j1fXKwq CXrcMp/Hbl1OQ2KSCIQ0XLGeFcCG4qsABg== X-Google-Smtp-Source: APXvYqwvYgsGL0qfF7KM5mXDJ6R7hLKUrusrauyt6+WM7XPyWh+mS62Fp5TjhMTWZhFoQztkBDb2BA== X-Received: by 2002:a2e:8942:: with SMTP id b2mr34968056ljk.38.1568536158519; Sun, 15 Sep 2019 01:29:18 -0700 (PDT) Original-Received: from [192.168.1.12] ([212.3.195.121]) by smtp.googlemail.com with ESMTPSA id m25sm7454227ljg.35.2019.09.15.01.29.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Sep 2019 01:29:17 -0700 (PDT) In-Reply-To: <87lfuqzv4n.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::243 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:240040 Archived-At: On 14.09.2019 19:43, Tassilo Horn wrote: >> Why exclude unregistered? I don't imagine they would slow anything >> down. > > Because IMHO they are not interesting except if they were just created > by myself and not yet added which seemed like a minor edge case (and at > least git ls-files lists files which are not yet committed but staged). Why else would they be there if not created by yourself? Machine-generated files are usually in gitignore. And every new file goes through this status. It would be an omission if project-find-file could find the file you just created (and probably working on). > And because it seems to me that git is more an exception in being able > to list unregistered files. If some VC backends just can't provide the full functionality, we should disable using them by default (and only leave 'Git in the defcustom you added, with some explanation). >> Speaking of ignores format, maybe they should just be whatever the >> backend in question understands, e.g. the contents of gitignore >> verbatim. > > I don't see how that would work except by modifying (or moving back and > forth) the existing .{git,hg,bzr}ignore to include project-vc-ignores. It's an option, although not a very fail-proof one. Git has helpful options like --exclude and --exclude-from, although it seems they don't affect the already tracked files. For which there are different things we can do: * Use negative patterns (https://stackoverflow.com/a/53083343/615245), this approach seems to recommend we use a separate argument like extra-ignores for the backend command. --exclude-from should help with whitelisting entries, though. * Grep the output, or process it in Emacs programmatically. * Idea from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=556584#10, though using it might not be the fastest option. Someone should benchmark it. With the first option, the command line would look like: git ls-files -c -o --exclude=!whitelisted-dir1 --exclude=!whitelisted-dir2 --exclude-standard ":!:extra-ignore1" ":!:extra-ignore2"