Stefan Reichör <[EMAIL PROTECTED]> writes:

> Stephen Leake <[EMAIL PROTECTED]> writes:
>
>> Stefan Reichör <[EMAIL PROTECTED]> writes:
>>
>>> Committed revision 517 to http://bzr.xsteve.at/dvc/
>>>
>>> Implemented xgit-branch
>>
>> In dvc-unified.el, you didn't use define-dvc-unified-command for
>> dvc-*-branch. What is the rationale for this?
>
> I am not sure, if we can use the same parameter list for all backends.
> dvc-* commands are normally not used for elisp scripting. They are used
> to invoke a command and DVC ensures that the correct backend is
> involved.
>
> The way I implemented it now, allows to have different parameters for
> each backend. I didn't look at other backends in detail, so I don't know
> if this is really needed.

I believe the convention is that at the top level
<backend>-dvc-<function>, the command list is the same. Backends can
extend that with &optional if they want to.
>
>> The comment in dvc-unified.el for dvc-select-branch is not clear. What
>> does "select" mean, in terms of what happens to the current workspace?
>
> In git select just switches to a different view (called branch) in the
> current directory.

I still don't know what that means.

Does only metadata change? is the new branch checked out? What files
are affected?

If only metadata changes, that seems dangerous; the workspace files
are correct for branch 1, but the metadata says they are on branch 2.

That may be appropriate for a newly created branch, but it's clearly
wrong for an old existing branch.

> I guess that every backend that supports branches allow to select a
> different branch. Selecting a branch should present a list of branches
> and the user should be able to pick one of them. 

That would be a good user interface. Perhaps the dvc-list-branches
could put up a list in an active buffer; various things  could then be
done to a selected branch; select, create new with current as parent,
merge with another branch, etc.

>> The comment for dvc-create-branch doesn't say what the parent branch
>> is.
>
> I don't know how a user would select a parent branch. When the parent
> branch (it is called start-point in my git documentation) is unknown,
> git uses a reasonable default.

In DVC, it would be appropriate to use the current branch of the
current workspace as the default parent. We should state that
explicitly, and backends should accomodate it.

>> In xgit.el, xgit-branch takes an argument giving the new branch name,
>> but dvc-create-branch takes no argument. Normally, we try to put all
>> argument processing in the dvc front-end, so the user interface is
>> more consistent across back-ends.
>
> As I said above, when we find compatible parameters for all our
> backends, we should use them. 

Clearly all backends will need a name for the new branch, so it is a
common parameter.

There should also be a parent branch name parameter, that defaults as
above if nil.

And as we discuss below, 'all' is a common parameter.

It might make sense to have workspace directory name as a parameter;
if non-nil, checkout the new branch to that directory. Or we need a
separate DVC command for this.

A separate DVC command is needed anyway; users will often want to
checkout an existing branch.

>> Apparently the branch is created with the current branch of the
>> current working directory as parent. In some cases, the user might
>> want to specify a different parent branch. Do we want to require them
>> to have that branch checked out?
>>
>> Does xgit-checkout change the branch of the current working directory?
>> Does it preserve any uncommitted changes?
>
> I don't know.

The top level DVC command needs to specify these things, so the users
know what to expect when they invoke it for different backends.

If the top level DVC command does _not_ specify common behavior for
all backends, then we are better off without it. Users can use the
backend-specific commands. That way they know not to expect common
behavior.

>> How do I checkout a branch into a new working directory?
>
> I guess you need to clone it to a different working directory.
> As far as I understood git branching, all takes place in the same
> working directory.

I meant what is the DVC command for this.

>> xgit-branch-list takes an 'all' argument. What branches are left out
>> if "all" is not specified? 
>
> It omits remote-tracking branches.
> But I have no idea how remote-tracking branches are used...
>
>> The 'all' option should be promoted to an argument to
>> dvc-list-branches. mtn has a way to "suspend" a branch, so it no
>> longer shows up in the branch list. The option --ignore-suspend-certs
>> overrides that, so it would make sense to specify that option for
>> "all".
>
> This seems reasonable.
>
>
> Stefan.
>

-- 
-- Stephe

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

Reply via email to