Re: [PATCH] branch: add '-' to delete previous branch
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Apr 29, 2020, 19:00 UTC
- Message-ID
- <20200429190013.GG83442@syl.local>
- In-Reply-To
- <877dxyo1k8.fsf@osv.gnss.ru>
On Wed, Apr 29, 2020 at 04:37:27PM +0300, Sergey Organov wrote:
Show 24 quoted lines
> Ivan Tham <pickfire@riseup.net> writes: > > > Add support to delete previous branch from git checkout/switch to have > > feature parity with git switch -. > > Maybe I'm late on this, but to me, who leaves in the Linux world, > "a_command -" strongly suggests a_command will read further input > from stdin. > > [...] > > > +To delete the previous branch:: > > ++ > > +------------ > > +$ git branch -D - > > ... so this suggests that the command, when used like this: > > $ echo "branch_name" | git branch -D - > > will delete "branch_name" rather than some "previous" branch, whatever > that means. > > Is this short-cut /that/ important to create yet another confusion?
I think that it may be causing more confusion now than it would be after Ivan's patch. 'git checkout', for example, also treats '-' as a synonym for '@{-1}'.
In my opinion, it is fairly clear that 'git branch -D -' means "delete the last branch", and not "delete a list of branches from stdin.
> -- Sergey
Thanks, Taylor