From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: A project-files implementation for Git projects Date: Tue, 10 Sep 2019 08:56:09 -0400 Message-ID: References: <8736h9rdc4.fsf@gnu.org> <87mufcfz1u.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="155130"; 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: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 10 14:56: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 1i7fhB-000eCr-Ke for ged-emacs-devel@m.gmane.org; Tue, 10 Sep 2019 14:56:33 +0200 Original-Received: from localhost ([::1]:39488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7fh9-0006IY-Gr for ged-emacs-devel@m.gmane.org; Tue, 10 Sep 2019 08:56:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33995) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7fgv-0006HV-OL for emacs-devel@gnu.org; Tue, 10 Sep 2019 08:56:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7fgt-0004ZX-6b for emacs-devel@gnu.org; Tue, 10 Sep 2019 08:56:17 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:24959) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7fgs-0004Y0-1H; Tue, 10 Sep 2019 08:56:15 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 62F1C8119A; Tue, 10 Sep 2019 08:56:12 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0B43780D8E; Tue, 10 Sep 2019 08:56:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1568120171; bh=ggT9R2A7OOwvKLvTB7PU+pEwd5yuk5wyyL7xH/8ZBt0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=DF1p11x1DDqHscwJ3EI9e4u9JsM3bQY6mE+S2KCgsbtX8E+2sQxQxn/OFbXaz1WCK 7MxxAMiWkSBTpEk1Zg4IwLCKlyn7wG5M2HEJUh5iiJ/nr/56HrznOUsZep62Qvodth 0fosj1n19O3N5mjn2O7xAHO9Pe858zgqX3DPaRsocp6lzkHeZtOD1Xq8VZ8+JZ6cAf UfPcOEKevDDAxo/AvcpEmK1mlhLBQF2Dd/7/3k64rub4twIwKaODTJ1MPHUbzBTw4Y 5uetwrDSbjqLOeCSTob75H0oO7l1MypxMW7ZjIsTBGzXeJBUcyG01rqNdVaH8/GwLg Yl1d7gLLOCbgQ== Original-Received: from pastel (unknown [108.175.224.31]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C7EE9120910; Tue, 10 Sep 2019 08:56:10 -0400 (EDT) In-Reply-To: <87mufcfz1u.fsf@gnu.org> (Tassilo Horn's message of "Tue, 10 Sep 2019 08:25:17 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:239976 Archived-At: > Would that mean that I would need to add functions > > vc-git-list-files (using: git ls-files) > vc-hg-list-files (using: hg files) > ... > > for all backends which support listing tracked files? For all backends for which you want to implement the feature yes. For the rest, you define `vc-default-list-files` instead. > And then project-files would call (vc-call-backend backend 'list-files) > and if that signals vc-not-supported call cl-call-next-method? No. If there's no vc--list-files, then it calls vc-default-list-files. No signal. > But how do I know the right backend without explicit tests? > vc-backend wants a file and all I have is the project's directory. IIRC, vc.el calls vc-backend with the directory name in those cases. > Also, I think most vc backends have a way to list tracked files but not > all those are faster than find is. If it's not faster, then don't bother implementing vc--list-files (unless the purpose is to get a different list rather than to get the list faster). > So name the vc function vc--list-files-fast and only provide > an implementation for Git? Sure. But please go through the vc-call-backend mechanism so as not to break the abstraction. Stefan