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 21:56:11 +0300 Message-ID: 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> 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="82121"; 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 20:56:28 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 1i9ZhD-000LGA-Sj for ged-emacs-devel@m.gmane.org; Sun, 15 Sep 2019 20:56:28 +0200 Original-Received: from localhost ([::1]:56468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i9ZhC-00075A-2y for ged-emacs-devel@m.gmane.org; Sun, 15 Sep 2019 14:56:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37079) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i9Zh4-000751-HP for emacs-devel@gnu.org; Sun, 15 Sep 2019 14:56:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i9Zh3-0007a4-Gx for emacs-devel@gnu.org; Sun, 15 Sep 2019 14:56:18 -0400 Original-Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]:45211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i9Zh3-0007Zl-9r for emacs-devel@gnu.org; Sun, 15 Sep 2019 14:56:17 -0400 Original-Received: by mail-lj1-x22b.google.com with SMTP id q64so21180062ljb.12 for ; Sun, 15 Sep 2019 11:56:17 -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=MnduNjcbS4O0/1D39wt9t1dTtctk0gnHphRK9xcPkB0=; b=QqP9X1ko1tqJwI8i9s/jd3CmGAvQtlzxToOgwUrtYHUjUmG08Ud3bM8b+2z6VmPuNL eqNS5wWaVO2xtXba1KgV0VSRqpNxDu4ChmiJ+6rZ64c7F9vpD9B8RYAAj2tgpTnW8T3s IlL5UEC55dl5EogBIah6tEwVpNi4wyeOkbbvX8JrSwUVUUpE6TRrI3OxtGYeOvmNDXDd R8vHIPymehYqN3HZS0zsEtbzJN29wj4VrW7gcPAqMXrWYUYgeUpgRPNIWVc9Df87yQDW hm63D7XrkAxs+BSRh396uwWMMN/23Rp8BxMP9bDnCMd+J42YKq1lews8XSL7KJFBQAbJ 6qnA== 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=MnduNjcbS4O0/1D39wt9t1dTtctk0gnHphRK9xcPkB0=; b=uL7Mea3XL4v29sTcX7t02+4PhPMIdml4Ypa9d9q07MwnniyoKo+UOj5WrVF29hQSvw eAgxiYF9fZAlqdl31isLaRfBwTmQvaKg5kBbo3avwYIMIE3/25LSe6yNx2zjIsW+pHJ1 9D2zphQP0ZXpFYkuDzSyhliHaAJ5oeONVigZN8aqXV3/D5DWOxWcWLB6hUNy+v6tlKlw s8Jq0V1x23a/0JIl6gLtyJg1Un/qfWmClGtx/V1WiChTwtcOITmEwMXiKZtNFhrUr4QK LZKP2zv11dFfn20IPirvTjv9PNb4BK/Rw9vegKqXeUjnTi55RDtAXoEk65R0XpTgkVSh J0eg== X-Gm-Message-State: APjAAAVF+dBgRptWrKjsBxVEaFatzPTPW8ND6vr7R3+0CQ4RxLS8dEP0 YrmX2owH0TxeNR+0R09QK/9ZXpiR X-Google-Smtp-Source: APXvYqzsWcJx3k0KeSu9cWSDoEjzZO4aO1fNG9qBo1psxdvsYJv7cD/IX8nle3p6xhcaE4Asu5UdNA== X-Received: by 2002:a2e:9147:: with SMTP id q7mr8811725ljg.95.1568573774399; Sun, 15 Sep 2019 11:56:14 -0700 (PDT) Original-Received: from [192.168.1.3] ([212.3.193.95]) by smtp.googlemail.com with ESMTPSA id t24sm8365275lfq.13.2019.09.15.11.56.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Sep 2019 11:56:13 -0700 (PDT) In-Reply-To: <87pnk2zvvy.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::22b 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:240051 Archived-At: On 14.09.2019 19:26, Tassilo Horn wrote: > As Eli said, just stat find is faster than, e.g., "bzr ls" on my > GNU/Linux system doesn't mean much. One benefit is that if you have a > bzr project, you'll have bzr installed. That doesn't need to be the > case for find at least on Windows systems. Makes sense. If 'find' is not available, defaulting to Bzr might be an option. Although I'm concerned that if it misses some of the files, it might be better to tell the user to install 'find'. > "bzr ls" has an --unknown flag which should list unknown files and an > --ignored flag to list ignored files, but in my version it then just > lists nothing when I specify either one. *shrug* I wouldn't spend too much time on this particular VCS. > "hg files" doesn't seem to have a way to list untracked files. Same for > subversion. I've only looked into Mercurial so far, and 'hg status -u' seems to do the trick. Depending on performance, you could call 'hg status -c -u', or augment the output of 'hg files' with a call to 'hg status -u'. > If you have an interface in mind (i.e., list-files all arguments and > their meaning), I can try and check how far we can get. I think it's either (list-files include-untracked extra-ignores whitelist) or (list-files pathspecs include-untracked all-ignores) where pathspecs defaults to nil meaning "all files" and all-ignores defaults to the current contents of .gitignore. It could also be interpreted as a file name, but I'm guessing most backends would have a hard time supporting this usage. In the latter case project-files's implementation would contain some backend-specific code, e.g. to translate additional ignores into pathspec values, so that they also apply to tracked files. Overall, I'm not 100% sure that we should use VC backend action here because it seems like we'll be fighting an impedance mismatch between what Git thinks its files are and what we want to see in the list of project files. We probably want to use Git because it's fast and flexible, but other VCSes are going to be less helpful. So if I were writing this myself I'd create a "fast path" for Git repos, and delegate to 'find' otherwise.