From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#2678: 23.0.91; vc-next-action in vc-dir acts strangely when only adds are necessary Date: Fri, 20 Mar 2009 19:54:05 -0700 (PDT) Message-ID: <200903210254.n2L2s5ep029446@godzilla.ics.uci.edu> References: <87d4cjcoan.fsf@catnip.gol.com> <200903201615.n2KGF70T023133@godzilla.ics.uci.edu> Reply-To: Dan Nicolaescu , 2678@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1237604679 18189 80.91.229.12 (21 Mar 2009 03:04:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Mar 2009 03:04:39 +0000 (UTC) Cc: 2678@emacsbugs.donarmstrong.com To: Miles Bader Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 21 04:05:55 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LkrWS-00058N-HL for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Mar 2009 04:05:52 +0100 Original-Received: from localhost ([127.0.0.1]:52171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkrV5-0001zs-On for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Mar 2009 23:03:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkrV2-0001zN-4h for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 23:03:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkrUw-0001un-FG for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 23:03:50 -0400 Original-Received: from [199.232.76.173] (port=52439 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkrUw-0001ua-9B for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 23:03:46 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:39988) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LkrUv-0006S3-K3 for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 23:03:45 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2L33htm001877; Fri, 20 Mar 2009 20:03:43 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n2L303qD000748; Fri, 20 Mar 2009 20:00:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com Resent-Date: Sat, 21 Mar 2009 03:00:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2678 X-Emacs-PR-Package: emacs,vc X-Emacs-PR-Keywords: Original-Received: via spool by 2678-submit@emacsbugs.donarmstrong.com id=B2678.123760405931829 (code B ref 2678); Sat, 21 Mar 2009 03:00:03 +0000 Original-Received: (at 2678) by emacsbugs.donarmstrong.com; 21 Mar 2009 02:54:19 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from sallyv2.ics.uci.edu (sallyv2.ics.uci.edu [128.195.1.120]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2L2sG2J031815 for <2678@emacsbugs.donarmstrong.com>; Fri, 20 Mar 2009 19:54:17 -0700 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by sallyv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id n2L2s5ut023742; Fri, 20 Mar 2009 19:54:05 -0700 (PDT) Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n2L2s5ep029446; Fri, 20 Mar 2009 19:54:05 -0700 (PDT) In-Reply-To: (Miles Bader's message of "Sat, 21 Mar 2009 11:28:12 +0900") Original-Lines: 51 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n2L2s5ut023742 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Fri, 20 Mar 2009 23:03:50 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:26524 Archived-At: Miles Bader writes: > On Sat, Mar 21, 2009 at 1:15 AM, Dan Nicolaescu wrot= e: > > Given that you are familiar with git, the function to fix to get this > > working is the one liner `vc-git-register': > > > > (defun vc-git-register (files &optional rev comment) > > =C2=A0"Register FILE into the git version-control system." > > =C2=A0(vc-git-command nil 0 files "update-index" "--add" "--")) > ... > > (vc-git-register "/tmp/zonk2/") >=20 > The obvious solution is to use "add" instead of "update-index --add". >=20 > [I tested it, it works.] >=20 > However, it'd be nice to ask whoever wrote this function originally > whether there was a reason for using "update-index" instead of "add", I'd assume it would be the vc-git.el author. > given that vc.el apparently expects higher-level level functionality > (recursion) from the register hook. I suppose update-index is the > more conservative choice, since it's officially "plumbing", but I'm > not aware of any problems with using the higher-level git-add in this > case. [The git backend already uses "add" in other places too.] >=20 > Also, I wonder: >=20 > (1) Given that vc-dir already has a list of files presented in the > directory listing, how come it doesn't give the backend that list, > instead of just the directory (having the backend do the recursion > seems more likely to yield unexpected results)? When the point is on the "./" entry (or before), and nothing is selected it means that you are asking for an action to be performed on the directory, that is gets sent to the VC command. If you want a list of files to be sent, mark a list of files and that is what will be sent. > (2) Perhaps vc-dir it should do a "revert-buffer" (or something) > afterwards when it operations on a subdirectory or the whole > directory, as any operation with the backend doing the recursion may > change something other than what is displayed. This is easy to see if > their were unregistered subdirectories with files -- doing "v" to > register a subdirectory adds all files in that directory, which vc-dir > hadn't displayed before, so currently "v" doesn't properly show them > afterwards (doing "g" shows them). It does, but there might be other things not working correctly with git, try with hg and you will see it working correctly.