From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: VC / Git: amend function / mark for add / timing Date: Tue, 13 Oct 2009 15:33:01 -0400 Message-ID: References: <9B112266-8695-41CB-A8EA-8D39833060AE@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1255462409 623 80.91.229.12 (13 Oct 2009 19:33:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Oct 2009 19:33:29 +0000 (UTC) Cc: julliard@winehq.org, spiegel@gnu.org, Emacs development discussions To: David Reitter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 13 21:33:18 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mxn7W-00026K-1R for ged-emacs-devel@m.gmane.org; Tue, 13 Oct 2009 21:33:18 +0200 Original-Received: from localhost ([127.0.0.1]:34358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxn7V-0008Hf-Cn for ged-emacs-devel@m.gmane.org; Tue, 13 Oct 2009 15:33:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mxn7Q-0008HP-0A for emacs-devel@gnu.org; Tue, 13 Oct 2009 15:33:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mxn7L-0008GC-G4 for emacs-devel@gnu.org; Tue, 13 Oct 2009 15:33:11 -0400 Original-Received: from [199.232.76.173] (port=45203 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxn7L-0008G9-BK for emacs-devel@gnu.org; Tue, 13 Oct 2009 15:33:07 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:54950) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mxn7I-0001K7-Mw; Tue, 13 Oct 2009 15:33:04 -0400 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n9DJX1oP012002; Tue, 13 Oct 2009 15:33:01 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 8A7333A07F; Tue, 13 Oct 2009 15:33:01 -0400 (EDT) In-Reply-To: <9B112266-8695-41CB-A8EA-8D39833060AE@gmail.com> (David Reitter's message of "Sun, 11 Oct 2009 19:30:28 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3383=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116114 Archived-At: > 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