Thread (1 message) 1 message, 1 author, 2019-03-22

Re: Bug: git checkout @{u} breaks git branch if the upstream isn't a local branch

From: Junio C Hamano <hidden>
Date: 2019-03-22 05:02:47

Leszek Swirski [off-list ref] writes:
I assume that either the reflog entry should be amended to print
something more informative (moving from master to origin/master, or at
least master@{u}, or the SHA...), or the reflog search in
wt_status_get_detached_from should do something cleverer with relative
refs.
Nicely analyzed. A record "moving to @{u}" in the reflog may not
leave sufficient information for a later operation to tell what
branch was refered to with the @{u} reference back when "checkout"
was run.  I suspect that checking out @{4}, @{1.day.ago}, etc. may
share the same issue.

"git checkout @{-1}" aka "git checkout -" may not have any problem
after such a checkout, as it only uses "moving from" side of the
reflog entry.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help