Thomas Gummerer <t.gumme...@gmail.com> writes:

> I like the idea of splitting those commands up, in fact it is
> something I've been considering working on myself.  I do think we
> should consider if we want to change the behaviour of those new
> commands in any way compared to 'git checkout', since we're starting
> with a clean slate.
>
> One thing in particular that I have in mind is something I'm currently
> working on, namely adding a --index flag to 'git checkout', which
> would make 'git checkout' work in non-overlay mode (for more
> discussion on that see also [*1*].

Ah, thanks for reminding me of that.  That explains why I felt
uneasy to see "restore" in the proposed command name.  In short, I
think "checkout --index <tree> <pathspec>", i.e. if the <pathspec>
matches a directory in <tree> and the current index and/or the
working tree has tracked paths in that directory that do not exist
in <tree>, the operation _removes_ these paths so that the result
matches <tree>, should become the default of "I want to check out
these paths from the named tree-ish".  The current one is not
exactly "checking out the paths" in that it ignores and does not
check out the absense of paths in <tree>.  That operation sounds
more like "restoring paths out of a given tree".  If the tree does
not have some paths, these paths won't be "restored" from that tree,
so "restore" matches the current "overlay what's taken out of the
given tree on top of what is already in the index and the working
tree, without checking out the absense of paths" better from that
point of view.


Reply via email to