[RFC] Delete current branch

2013-07-19 Thread Ramkumar Ramachandra
Hi, Many of my ideas turn out to be really stupid, and I need to throw away my feature branch. So, I find myself doing this often: # on branch menuconfig-jk $ git checkout master $ git branch -D # er, what was the branch name again? $ git checkout - # Ah $ git checkout master $ g

Re: [RFC] Delete current branch

2013-07-19 Thread Ramkumar Ramachandra
Andreas Schwab wrote: > Ramkumar Ramachandra writes: > >> # er, what was the branch name again? >> $ git checkout - > > You could take a look in the reflog. Yeah, or use the @{-N} revision to do that for me. My scripted version is essentially: test "true" = "$(git rev-parse --is-inside-wo

Re: [RFC] Delete current branch

2013-07-19 Thread Andreas Schwab
Ramkumar Ramachandra writes: > # er, what was the branch name again? > $ git checkout - You could take a look in the reflog. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely differe

Re: [RFC] Delete current branch

2013-07-19 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Many of my ideas turn out to be really stupid, and I need to throw > away my feature branch. So, I find myself doing this often: > > # on branch menuconfig-jk > $ git checkout master > $ git branch -D > # er, what was the branch name again? > $ git checko

Re: [RFC] Delete current branch

2013-07-19 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > Did you know that the general way to spell the branch previously you > were on is "@{-1}" and "checkout -" is an ugly special case that is > possible only because "checkout" does not happen to take a "-" as a > valid argument that means something else (like the more usual "r

Re: [RFC] Delete current branch

2013-07-19 Thread Taylor Hedberg
Junio C Hamano, Fri 2013-07-19 @ 09:48:06-0700: > But there is a very commonly accepted long tradition for "-" to mean > "read from the standard input", so we cannot reuse it to mean "the > branch I was previously on" for every command without first making > sure the command will never want to use

Re: [RFC] Delete current branch

2013-07-19 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Junio C Hamano wrote: >> Did you know that the general way to spell the branch previously you >> were on is "@{-1}" and "checkout -" is an ugly special case that is >> possible only because "checkout" does not happen to take a "-" as a >> valid argument that means s

Re: [RFC] Delete current branch

2013-07-19 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > That limits the context we could use "-" and we cannot consistently > use it everywhere. I find _that_ ugly from the "design cleanliness" > point of view. Right, noted. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@v

Re: [RFC] Delete current branch

2013-07-19 Thread Junio C Hamano
Taylor Hedberg writes: > Junio C Hamano, Fri 2013-07-19 @ 09:48:06-0700: >> But there is a very commonly accepted long tradition for "-" to mean >> "read from the standard input", so we cannot reuse it to mean "the >> branch I was previously on" for every command without first making >> sure the

Re: [RFC] Delete current branch

2013-07-19 Thread Junio C Hamano
Junio C Hamano writes: > Ramkumar Ramachandra writes: > >> Junio C Hamano wrote: >>> Did you know that the general way to spell the branch previously you >>> were on is "@{-1}" and "checkout -" is an ugly special case that is >>> possible only because "checkout" does not happen to take a "-" as