Re: [PATCH] branch: add '-' to delete previous branch
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 29, 2020, 20:22 UTC
- Message-ID
- <xmqqa72uvy7n.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200429195745.GC3920@syl.local>
Taylor Blau <me@ttaylorr.com> writes:
> Again, not sure that this is always the case. This *is* how 'git > checkout' works.
To be honest, I am somewhat sympathetic to those who find "-" == "@{-1}" unless it is used as an argument to "git checkout/switch". The use of "-" in "checkout" is the exception, not the norm, and it was sort of justifiable due to similarity to "cd -". Both are commands to the computer you give to "go to the previous place".
"git merge -", "git branch -d -" etc. are not about *going* to the previous place, and declaring the "-" is "previous place" is taking it a bit too far, at least to my taste.
Oh, I do not like those who advocate "@" as a synonym for "HEAD", either. If there is one simple thing I want to get rid of from the system, that's it ;-).
Anyway...