Thread (1 message) 1 message, 1 author, 2017-06-06

Re: [PATCH/RFC v4 3/3] branch: add copy branch feature implementation

From: Junio C Hamano <hidden>
Date: 2017-06-06 00:14:56

Junio C Hamano [off-list ref] writes:
When somebody says "I want to rename my current branch to X", it is
clear that the person wants to end up being on a branch called X.

To me, "I want to copy my current branch to Y" sounds more like "I
want to create another Y that looks just like the current branch,
but I want stay on my current branch".

If you think copy makes @{-1} problematic, perhaps your copy is
doing more than it should (e.g. switching the current branch at the
same time, or something).
A related tangent.  Git does not assign any identity to a branch, so
"the branch we were previously on" goes strictly by name.  If you
are on branch X, switched to branch Y, and then renamed branch X
(which is not current) to branch Z, Git will still think that the
previous branch is X, so an attempt to switch back to @{-1} may do
unexpected things.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help