Michael Olson <[EMAIL PROTECTED]> writes:
> 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.
I don't understand; what do you mean by "invasive" here?
As it currently stands, xgit-dvc does not provide partial commit
functionality, using ewoc marked files as the user interface.
What alternate proposal are you making to provide that?
Hmm. I guess at the moment, the user can call dvc-add to add any file
(even one that git already knows about, but is modified) to the git
index, then call dvc-log-edit-done to commit them. But then the DVC
user interface does not show what files will be committed, and using
dvc-add this way is an abuse; if that same user then tries to work in
the same way with xmtn or bzr, they will get errors ("file already
added" or some such).
> 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".
You seem to be confusing two issues; I am talking about making partial
commits work for xgit, you are talking about cleaning up the ewoc
after them. I've changed the subject on this message to the former.
Once we agree on how partial commits will work for xgit in the first
place, then we can continue the discussion of how to clean up after
them.
--
-- Stephe
_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev