Re: [PATCH] branch: delete now accepts '-' as branch name

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

 



On 2/16/22 11:54 AM, Junio C Hamano wrote:
From: "Erlend E. Aasland" <erlend.aasland@xxxxxxxxx>
This makes it easy to get rid of short-lived branches:

$ git switch -c experiment
$ git switch -
$ git branch -D -

Or you can use @{-1} directly.  Or short-lived experiment can
directly be done on HEAD without any branch ;-)

Thanks for trying to make Git better.

Patches implementing this behavior for `git branch -D` have been submitted previously but were rejected (if I recall correctly) since "delete" is a destructive operation, unlike other cases in which `-` is accepted. A relatively recent submission and ensuing discussion is at [1].

[1]: https://lore.kernel.org/git/20200501222227.GE41612@syl.local/T/



[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