Re: [PATCH][Outreachy] branch -D: allow - as abbreviation of @{-1}

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

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

> On Mon, Mar 21, 2016 at 1:47 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> writes:
>>> But I'm not sure how often people want to delete (force-delete according
>>> to your message) the branch they just come from.
>>
>> One that I heard was this sequence:
>>
>>     $ git checkout -b work master
>>     $ work work work ...
>>     $ git checkout master
>>     $ git merge work
>>     $ git branch -d work
>>
>> where their argument was that they are done with the work branch,
>> and it no longer is needed.
>
> I frequently use throwaway branches when messing around with some idea
> or when reviewing patches submitted to the mailing list, and the
> workflow ends up being similar to the above:
>
>     $ git checkout -b throwaway master
>     $ ...work work work...
>     $ git checkout master
>     $ git branch -D throwaway
>
> So, I can see how having "git branch -D" (force-delete) recognize "-"
> could be a convenience.

I guess that it would make some sense in ancient world, but there is
detached HEAD for that workflow, so it is unlikely that I'd find it
useful myself (in my worldview, throw-away work is discardable by
default, which is why I start from detached HEAD, until I find that
the result is more interesting than I originally thought and decide
to save it to a more permanent branch with "checkout -b" from
there).

But of course people are different.

In any case, we found two plausible explanation why people may want
to do this.  I however tend to agree with Matthieu that it may be
safer not to give a short-hand access to destructive operations.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]