all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: David Reitter <david.reitter@gmail.com>
Cc: julliard@winehq.org, spiegel@gnu.org,
	Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: VC / Git: amend function / mark for add / timing
Date: Tue, 13 Oct 2009 15:33:01 -0400	[thread overview]
Message-ID: <jwveip7drnk.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <9B112266-8695-41CB-A8EA-8D39833060AE@gmail.com> (David Reitter's message of "Sun, 11 Oct 2009 19:30:28 -0500")

> 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




  parent reply	other threads:[~2009-10-13 19:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12  0:30 VC / Git: amend function / mark for add / timing David Reitter
2009-10-12  6:55 ` David Kastrup
2009-10-13 17:28 ` Dan Nicolaescu
2009-10-13 22:34   ` Juri Linkov
2009-10-13 19:33 ` Stefan Monnier [this message]
2009-10-13 20:37   ` Alexandre Julliard

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=jwveip7drnk.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=julliard@winehq.org \
    --cc=spiegel@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.