Matthieu Moy <[EMAIL PROTECTED]> writes:

> Michael Olson <[EMAIL PROTECTED]> writes:
>
>> Committed revision 281 to http://mwolson.org/bzr/dvc/
>>
>> xgit: Check in improved version of xgit-addremove
>>   
>>   * lisp/xgit.el (xgit-addremove): Use improved variant of this command
>>     from the git mailing list, which avoids using pipes and xargs.
>
> +  (dvc-run-dvc-sync
> +   'xgit (list "add" ".")
> +   :finished (lambda (output error status arguments)
> +               (dvc-run-dvc-sync
> +                'xgit (list "add" "-u")
> I'd add a "." here, -------------------^ to be consistant : in case
> you run this from a subdirectory of the repository, "add" "." will add
> unknown files in this directory only, so let's do the same for "add
> -u". Otherwise wrap this with 
> ((let (default-directory (dvc-tree-root) ...)))
> .

Done.

> Otherwise, this has the side effect of adding the new content of
> existing files too. I'm not sure whether this is a good or bad side
> effect ;-).

This is the easiest way to do it.  I don't think mercurial exposes the
index, so we can't tell from the documentation what they would do in a
git context.  My own use case for this is to quickly snapshot a
directory and get visual feedback on it in the status buffer, not to
just add removed and newly added files to the index, so I went with
that.

"git add ." has the effect of adding both untracked files and changed
files, while "git add -u ." has the effect of removing deleted files
From the index.  There's no good way to decouple the functionality in
"git add .".  I really don't want to deal with the "piping without using
shell pipes" issue, which would be necessary if we wanted to only add
untracked and remove deleted.

-- 
       Michael Olson -- FSF Associate Member #652     |
 http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net  |  /` |\ | | |
            Sysadmin -- Hobbies: Lisp, GP2X, HCoop    | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |

Attachment: pgpJyGiGLi6MV.pgp
Description: PGP signature

_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev

Reply via email to