emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VC / Git: amend function / mark for add / timing


From: Stefan Monnier
Subject: Re: VC / Git: amend function / mark for add / timing
Date: Tue, 13 Oct 2009 15:33:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> It would be nice if VC provided a function to add the "--amend" argument to
> "git commit" so that the last commit is amended.  This is useful when one
> forgets to check in file, especially after using C-x v  v to commit a single
> file.   The logical binding I thought of at first was C-u C-x v v, but that
> seems to do something else.

Maybe VC should provide a generic way to provide addition args to pass
to the backend.

> Finally, it takes several seconds when I open a file that's under git
> version control.  What can we do about this?  I think I complained
> about it at some point, and we didn't find a solution.

Currently VC's design is that it assesses the file's VC-status (mostly,
whether or not it's under VC control and if so, under which backend and
what is its current revision number and/or modification status) when the
file gets opened, synchronously.

This presumes that vc-registered is very quick.  If it is not, we have
a problem.  In the case of Git, I believe there's no easy way for Emacs
to figure out whether a file is under Git's control short of running
Git, so the speed of vc-registered will depend on the speed of Git.

If you find this to be too slow, here's what we can do:
1- try to change vc-git-registered so it uses different Git commands
   that are quicker.
2- change vc-git-registered to always return non-nil in Git
   repositories, even for files which actually aren't controlled by Git,
   so we don't even need to run Git to get this answer.  This may
   require further changes to make sure that no other info is needed
   (e.g. file modification status) before a VC command is actually
   run.  It may also require moving Git to the end of
   vc-handled-backends.
3- as you suggest make it work asynchronously.  This would probably look
   like `2' above, except that the relevant info would appear later on,
   asynchronously, rather than doing it synchronously at the first
   VC command invocation.

So the first step would be to figure out *why* is the code so slow.
Is Git the culprit?  If so, why is it so slow?


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]