Stephen Leake <[EMAIL PROTECTED]> writes: > Michael Olson <[EMAIL PROTECTED]> writes: > >> Stephen Leake <[EMAIL PROTECTED]> writes: >> >>> Michael Olson <[EMAIL PROTECTED]> writes: >>> >>>> The git backend does not work that way. You basically add files to >>>> the index using xgit-add or "git add" from commandline or "a" from >>>> the status buffer. To indicate that you want to commit just the >>>> files you've manually added to index, mark *any* of the files and >>>> do C-x V c C-c C-c. >>> >>> Is that the process for committing changes to modified files? That >>> seems odd. >> >> That is indeed how it is done. git has its own index for keeping >> track of which files need to be added in the current commit -- >> marking at least one file before bringing up the log-edit buffer >> indicates to DVC that it should do a normal git commit, which uses >> just the index. If no files were marked, then DVC will do "git >> commit -a", which commits everything that has changed, rather than >> just what has been added to the index. > > Ok. > > So either dvc needs to keep the git index and the ewoc marked files in > sync, or it needs to run "git add" for each marked file at commit time. > > If you choose the former approach, then dvc-status and dvc-diff should > query the current index, and mark the files that are in it. In > addition, dvc-diff-mark-file needs to call a new dvc dispatching > function (dvc-mark-file path t) that xgit would map to "git add". This > cannot be dvc-add-files, because the other back-ends would do the > wrong thing. And dvc-diff-unmark-file needs to undo that, perhaps via > (dvc-mark file path nil); I assume there is a "git unadd" or > equivalent? > > For the latter approach, xgit-dvc-log-edit-done needs to run "git add" > for all marked files, then run "git commit". > > I think the second approach is simpler. The first has the advantage of > making marks persistent across dvc sessions, although that could also > be a problem.
Neither approach is acceptable -- both are too invasive. You need to
allow backends to override this functionality. With git, I would
specify a function which deletes all cookies after a commit and adds the
message "Recently committed, hit `g' to refresh".
--
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 |
pgprt0NS4NbxJ.pgp
Description: PGP signature
_______________________________________________ Dvc-dev mailing list [email protected] https://mail.gna.org/listinfo/dvc-dev
