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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, 15 Jan 2009, Junio C Hamano wrote:

> I do not see a reason to limit the new notation "where I was" only to 
> "git checkout".  Wouldn't it be handy if you can use the notation as the 
> other branch to merge from, or the commit to rebase on?
> 
> [...]
> 
> Another reason is the one level limitation.  If we do not use LAST_HEAD,
> and instead used HEAD reflog, to get to this information, there is no
> reason we cannot to give an equally easy access to the second from the
> last branch the user was on.
> 
> So I think it is just the matter of coming up with a clever syntax that
> works on reflogs to name the nth last branch we were on and teach that
> syntax to both get_sha1() and resolve_ref().
> 
> With the attached illustration patch,
> 
>      $ git checkout junk
>      $ git chekcout master
>      $ git checkout @{-1}
> 
> will take you back to junk branch.  It probably would serve as a starting
> point, if anybody is interested.

I like it.  Additionaly, we could teach "checkout" that "-" is 
equivalent to "@{-1}", as checkout cannot possibly take stdin, so 
it would not hurt.  Thomas?

Ciao,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux