Matthieu Moy <[EMAIL PROTECTED]> writes:

> Stephen Leake <[EMAIL PROTECTED]> writes:
>
>> 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.
>> 
>> [...]
>>
>> For the latter approach, xgit-dvc-log-edit-done needs to run "git add"
>> for all marked files, then run "git commit".
>
> One precision: in git, you have at least two ways to do a partial
> commit.
>
> $ git add foo
> $ git add bar
> $ git commit -m "commited foo and bar"
>
> or
>
> $ git commit -a -m "commited foo and bar" -- foo bar

Ah. So the current xgit-dvc-log-edit-done code could be changed to
something like:

    (if files-to-commit
        (dvc-run-dvc-sync
         'xgit (append (list "commit" "-a"
                         "-F" (dvc-log-edit-file-name)
                         "--") files-to-commit))
    ;; commit all files
    (dvc-run-dvc-sync
     'xgit (list "commit" "-a" "-F" (dvc-log-edit-file-name))))


Then xgit would be similar to bzr with respect to cleaning up the
status and diff buffers after a commit.

> And both can make sense. The first should be achieved with xgit-add,

As long as the user does _not_ use "dvc-add" for this, that's ok.

I guess we don't need to make dvc-add _forbid_ such use. But it will
be confusing if people use it that way.

But using xgit-add, instead of some other/new DVC front-end function,
means the DVC user interface will not show the list of files to
commit. That's a serious problem.

The goal of DVC is to have users _never_ invoke a back-end function
directly. So there should be a "dvc-*" function that does what is
needed here; the user should _not_ be calling xgit-add.

> the second with marking IMHO.

I don't see why the user interface style should be dictated by which
back-end is used. The point of having separate front-end and back-end
is to allow mapping one user interface onto several different
back-ends. Or, in the long run, several different user interfaces onto
several different back-ends :).

Having "dvc-mark-files" call "xgit-add" makes sense to me; why do you
think that should not be done?

Hmm. I guess that could be wrong for unknown files; the user might be
marking them to ignore them, not add them. So then "dvc-ignore-files"
would have to call "xgit-unadd". And so on for most other
dvc-functions that operate on marked files.

So perhaps it is best if DVC simply not use "git add" for anything
other than unknown files. Would that be ok?

-- 
-- Stephe

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

Reply via email to