Thread (35 messages) 35 messages, 8 authors, 2016-06-15

Re: [PATCH] checkout: implement "-" shortcut name for last branch

From: Thomas Rast <hidden>
Date: 2016-06-15 22:45:57

Johannes Schindelin wrote:
On Thu, 15 Jan 2009, Thomas Rast wrote:
quoted
Let git-checkout save the old branch as a symref in LAST_HEAD, and
make 'git checkout -' switch back to LAST_HEAD, like 'cd -' does in
the shell.
Actually, what you want is in the reflog, no?  So... parsing 
.git/logs/HEAD for the latest occurrence of "checkout: moving from " and 
then using everything up until the next space should give you the branch 
name, right?
It just feels wrong to grab that information from there; it's a
free-form comment field for user consumption.  And it wasn't even that
hard to implement a LAST_HEAD.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help