git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 21, 2016, 17:56 UTC
Message-ID
<CAPig+cQNBeBaLb-znNgxOanUz++pQLae=c8vUtFXjqxOns4d-g@mail.gmail.com>
In-Reply-To
<xmqqtwjzn2nu.fsf@gitster.mtv.corp.google.com>
On Mon, Mar 21, 2016 at 1:47 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> 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.

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 8 in “[Outreachy] branch -D: allow - as abbreviation of @{-1}”
  1. [Outreachy] branch -D: allow - as abbreviation of @{-1}Elena Petrashen, Mar 21, 2016
  2. Matthieu MoyMar 21, 2016
  3. Junio C HamanoMar 21, 2016
  4. Eric SunshineMar 21, 2016
  5. Junio C HamanoMar 21, 2016
  6. Eric SunshineMar 21, 2016
  7. Eric SunshineMar 21, 2016
  8. Stefan BellerMar 21, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.