all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Miles Bader <miles@gnu.org>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: 2678@emacsbugs.donarmstrong.com
Subject: bug#2678: 23.0.91; vc-next-action in vc-dir acts strangely when only adds are necessary
Date: Sat, 21 Mar 2009 11:28:12 +0900	[thread overview]
Message-ID: <fc339e4a0903201928r714f3b8eg79d9fd362ad13f93@mail.gmail.com> (raw)
In-Reply-To: <200903201615.n2KGF70T023133@godzilla.ics.uci.edu>

On Sat, Mar 21, 2009 at 1:15 AM, Dan Nicolaescu <dann@ics.uci.edu> wrote:
> 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)
>  "Register FILE into the git version-control system."
>  (vc-git-command nil 0 files "update-index" "--add" "--"))
...
> (vc-git-register "/tmp/zonk2/")

The obvious solution is to use "add" instead of "update-index --add".

[I tested it, it works.]

However, it'd be nice to ask whoever wrote this function originally
whether there was a reason for using "update-index" instead of "add",
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.]

Also, I wonder:

  (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)?

   (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).

thanks,

-miles

-- 
Do not taunt Happy Fun Ball.






  reply	other threads:[~2009-03-21  2:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-15  6:06 bug#2678: 23.0.91; vc-next-action in vc-dir acts strangely when only adds are necessary Miles Bader
2009-03-15 14:59 ` Dan Nicolaescu
2009-03-20 16:15 ` Dan Nicolaescu
2009-03-21  2:28   ` Miles Bader [this message]
2009-03-21  2:54     ` Dan Nicolaescu
2009-03-21  3:00       ` Miles Bader
2009-03-21  3:50         ` Dan Nicolaescu
2009-03-21  4:14           ` Miles Bader
2009-03-21  4:30             ` Dan Nicolaescu
2009-03-21  4:39               ` Miles Bader
2009-03-21 14:10           ` Stefan Monnier
2009-03-21 15:39             ` Dan Nicolaescu
2009-03-23 16:31             ` Dan Nicolaescu
2009-03-23 17:25               ` Stefan Monnier

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=fc339e4a0903201928r714f3b8eg79d9fd362ad13f93@mail.gmail.com \
    --to=miles@gnu.org \
    --cc=2678@emacsbugs.donarmstrong.com \
    --cc=dann@ics.uci.edu \
    /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.