Re: [PATCH v2] checkout: implement "-" shortcut name for last branch
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 15, 2009, 13:15 UTC
- Message-ID
- <alpine.DEB.1.00.0901151413250.3586@pacific.mpi-cbg.de>
- In-Reply-To
- <496EE559.3060901@viscovery.net>
Hi,
On Thu, 15 Jan 2009, Johannes Sixt wrote:
Show 17 quoted lines
> Thomas Rast schrieb: > > 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. > > /me likes this feature. > > git rebase (-i or not) calls checkout behind the scenes if the > two-argument form is used: > > git rebase [-i] master topic > > and 'topic' is not the current branch. You may want to add a test that > ensures that rebase sets LAST_HEAD in this case. > > You must make sure that commits referenced by LAST_HEAD are not > garbage-collected. (I don't know if this happens anyway for symrefs in .git.)
Note: if you used reflogs for that feature, the garbage collection could not have killed the commit. However, it is quite possible that the branch was deleted.
Ciao, Dscho