all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: A project-files implementation for Git projects
Date: Wed, 11 Sep 2019 13:00:49 +0200	[thread overview]
Message-ID: <87a7bbjdwe.fsf@gnu.org> (raw)
In-Reply-To: <jwv7e6gi7i6.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 10 Sep 2019 09:56:44 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan, Dmitry & Eli,

>> But what should this do?  From a vc list-files function I'd expect
>> (and document) that it lists all and only tracked files.  So should
>> the default implementation use find to locate all files and then
>> check each one if it is tracked using vc-state (or something alike)?
>
> I'd pass it a "fallback" function, so you'd have something like:
>
>     (defun vc-default-list-files-fast (backend ... fallback)
>       (funcall fallback))
>
> and in the call you'd do
>
>     (vc-call-backend (vc-responsible-backend dir)
>      'list-files-fast ... #'cl-call-next-method)

Ah, right, that's a good idea!

>> (vc-backend "~/Repos/el/emacs") => nil
>> But that's my emacs git checkout...
>
> Ah, indeed, it seems you want vc-responsible-backend instead.

(vc-responsible-backend "~/Repos/el/emacs") => Git

Yup, that's it!

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 10.09.2019 16:39, Tassilo Horn wrote:
>> But what should this do?  From a vc list-files function I'd expect
>> (and document) that it lists all and only tracked files.  So should
>> the default implementation use find to locate all files and then
>> check each one if it is tracked using vc-state (or something alike)?
>
> I'd really like it to be more feature-rich. I.e. to accept arguments
> which files it will return, or blacklist/whitelist.
>
> In my limited testing, Git can handle it and will still return the
> list of files much faster than the current find-based solution.
>
> It's a bit more complex to implement, though. That's why it has been
> on my list for a while without much progress.

Yes, I guess ideally it would take a list of vc-states like up-to-date,
edited, needs-update (probably with the exclusion of unregistered) and
list the files in any of the given states.

I'll start simple with listing all tracked files...

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Tassilo Horn <tsdh@gnu.org>
>> Date: Tue, 10 Sep 2019 08:25:17 +0200
>> Cc: emacs-devel@gnu.org
>> 
>> Also, I think most vc backends have a way to list tracked files but
>> not all those are faster than find is.  "git ls-files" is much faster
>> than find but short testing revealed that "hg files" is much slower.
>
> "hg files"?  Did you mean "hg locate", perhaps?  Or are there new
> commands in hg that were added lately?  (My installation of Mercurial
> is quite old, so maybe I'm out of touch.)

Seems so.

--8<---------------cut here---------------start------------->8---
$ hg files --help
hg files [OPTION]... [FILE]...

list tracked files

    Print files under Mercurial control in the working directory or
    specified revision for given files (excluding removed files). Files
    can be specified as filenames or filesets.

    If no files are given to match, this command prints the names of all
    files under Mercurial control.
--8<---------------cut here---------------end--------------->8---

> Anyway, whether 'find' or the VC-specific way is faster might be OS
> dependent.  I'm guessing you tested on GNU/Linux;

Yes.

> on MS-Windows, I get the opposite results for both hg and bzr (let
> alone Git), even though my build of GNU Find is highly optimized and
> generally much faster than other ports available on Windows.  Plus,
> 'find' might not be available on Windows, whereas the VC backend for a
> repository must be available, almost by definition.
>
> So at the very least this should be customizable, and in general,
> unless 'find' is orders of magnitude faster, I'd prefer to use VC in
> all cases.

Ok, you are right.  I'll work on it and report back.

Bye,
Tassilo



  reply	other threads:[~2019-09-11 11:00 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06  9:19 A project-files implementation for Git projects Tassilo Horn
2019-09-06 12:52 ` Stefan Monnier
2019-09-10  6:25   ` Tassilo Horn
2019-09-10 12:56     ` Stefan Monnier
2019-09-10 13:39       ` Tassilo Horn
2019-09-10 13:56         ` Stefan Monnier
2019-09-11 11:00           ` Tassilo Horn [this message]
2019-09-11 20:01             ` Tassilo Horn
2019-09-13 20:38               ` Tassilo Horn
2019-09-14  0:29               ` Dmitry Gutov
2019-09-14 16:26                 ` Tassilo Horn
2019-09-15 18:56                   ` Dmitry Gutov
2019-09-16  2:27                     ` Eli Zaretskii
2019-09-16  3:36                       ` Dmitry Gutov
2019-09-16 15:25                         ` Eli Zaretskii
2019-09-17 10:46                           ` Dmitry Gutov
2019-09-17 12:03                             ` Eli Zaretskii
2019-09-17 12:55                               ` Dmitry Gutov
2019-09-17 13:14                                 ` Eli Zaretskii
2019-09-19 15:33                                   ` Dmitry Gutov
2019-09-19 17:29                                     ` Eli Zaretskii
2019-09-20 11:25                                       ` Dmitry Gutov
2019-09-20 12:59                                         ` Eli Zaretskii
2019-09-20 13:28                                           ` Dmitry Gutov
2019-09-20 13:45                                             ` Stefan Monnier
2019-09-20 13:54                                               ` Dmitry Gutov
2019-09-20 14:12                                                 ` Michael Albinus
2019-09-20 14:30                                                   ` Eli Zaretskii
2019-09-20 14:51                                                     ` Dmitry Gutov
2019-09-20 15:04                                                       ` Michael Albinus
2019-09-22  9:23                                                         ` Dmitry Gutov
2019-09-20 14:55                                                     ` Michael Albinus
2019-09-20 15:55                                                       ` Eli Zaretskii
2019-09-20 15:01                                                 ` Stefan Monnier
2019-09-20 15:59                                                   ` Eli Zaretskii
2019-09-20 17:32                                                     ` Stefan Monnier
2019-09-20 17:49                                                       ` Eli Zaretskii
2019-09-20 18:04                                                         ` Stefan Monnier
2019-09-20 14:23                                             ` Eli Zaretskii
2019-09-20 14:48                                               ` Dmitry Gutov
2019-09-16 13:32                     ` Tassilo Horn
2019-09-17 11:06                       ` Dmitry Gutov
2019-09-18 17:15                         ` Tassilo Horn
2019-09-19 16:01                           ` Dmitry Gutov
2019-09-22  8:56                             ` Tassilo Horn
2019-09-22  9:37                               ` Dmitry Gutov
2019-09-23  7:42                                 ` Tassilo Horn
2019-09-23 12:22                                   ` Dmitry Gutov
2019-09-27 16:17                                     ` Tassilo Horn
2019-09-30  0:09                                       ` Dmitry Gutov
2019-09-30  0:25                                         ` Stefan Monnier
2019-09-30  6:50                                           ` Dmitry Gutov
2019-09-30 17:09                                             ` Stefan Monnier
2019-10-01  8:19                                               ` Dmitry Gutov
2019-10-01 12:31                                                 ` Stefan Monnier
2019-10-01 13:10                                                   ` Stefan Monnier
2019-10-01 23:38                                                     ` Dmitry Gutov
2019-10-03  9:25                                                       ` Felician Nemeth
2019-10-03 10:32                                                         ` Dmitry Gutov
2019-10-03 11:15                                                           ` Felician Nemeth
2019-10-03 12:31                                                             ` Dmitry Gutov
2019-10-03 14:39                                                               ` Felician Nemeth
2019-10-03 14:42                                                                 ` Dmitry Gutov
2019-10-03 15:10                                                                   ` Felician Nemeth
2019-10-03 15:15                                                                     ` Dmitry Gutov
2019-10-01  8:11                                         ` Dmitry Gutov
2019-10-03  8:33                                           ` Tassilo Horn
2019-10-03 13:19                                             ` Dmitry Gutov
2019-10-03 17:15                                               ` Tassilo Horn
2019-10-03 22:49                                                 ` Dmitry Gutov
2019-10-04  7:47                                                   ` Tassilo Horn
2019-10-04  7:58                                                     ` Tassilo Horn
2019-10-04 13:16                                                       ` Dmitry Gutov
2019-10-04  8:49                                                     ` Tassilo Horn
2019-10-04 12:57                                                       ` Dmitry Gutov
2019-10-04 13:59                                                         ` Tassilo Horn
2019-10-04 15:24                                                           ` Dmitry Gutov
2019-10-04 12:16                                                     ` Stefan Monnier
2019-10-04 13:08                                                     ` Dmitry Gutov
2019-10-03  7:41                                         ` Tassilo Horn
2019-10-03 12:33                                           ` Dmitry Gutov
2019-10-03 12:51                                             ` Tassilo Horn
2019-10-04  5:52                                             ` Co-authoring and attribution in commit message (was: A project-files implementation for Git projects) Kévin Le Gouguec
2019-10-04  8:33                                               ` Co-authoring and attribution in commit message Dmitry Gutov
2019-10-04 21:36                                                 ` Karl Fogel
2019-10-05  6:55                                                   ` Eli Zaretskii
2019-10-03 23:02                                         ` A project-files implementation for Git projects Dmitry Gutov
2019-09-14  0:33             ` Dmitry Gutov
2019-09-14 16:43               ` Tassilo Horn
2019-09-15  8:29                 ` Dmitry Gutov
2019-09-15  9:06                   ` Dmitry Gutov
2019-09-10 13:57         ` Robert Pluim
2019-09-10 14:24         ` Dmitry Gutov
2019-09-10 14:41     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7bbjdwe.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.