Re: [PATCH] branch: add '-' to delete previous branch

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

 



On Wed, Apr 29, 2020 at 3:00 PM Taylor Blau <me@xxxxxxxxxxxx> wrote:
> On Wed, Apr 29, 2020 at 04:37:27PM +0300, Sergey Organov wrote:
> > Ivan Tham <pickfire@xxxxxxxxxx> 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.
> >
> > 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.

I can't find the discussion right now, but I have a recollection that
"git branch -D -" was explicitly rejected when "-" was being added as
an alias for @{-1} to other modes and other commands. The reason for
the rejection was that branch deletion is a destructive operation (the
ref-log, in particular, is gone after deletion), and "-" alone
provides no clues and no context that you're deleting the branch you
intend to delete. (The lack of clues and context isn't a big deal for
non-destructive commands, such as git-switch.)



[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