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

Re: [PATCH v2] branch: implement shortcut to delete last branch

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 26, 2018, 16:49 UTC
Message-ID
<xmqqvadidbo7.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<86r2o7nh4i.fsf@matthieu-moy.fr>
git@matthieu-moy.fr writes:
>> That said, I'd still be OK with it.
>
> I don't have objection either.

FWIW, I do not even buy the "destructive commands should force spelling things out even more" argument in the first place.

    $ git checkout somelongtopicname
    $ work work work
    $ git checkout master && git merge -
    $ git branch -d -

would be a lot less error-prone than the user being forced to write last step in longhand

    $ git branch -d someotherlongtopicname
and destroying an unrelated but similarly named branch.
So obviously I am OK with it, too.

As long as we do not regress end-user experience, that is. For example, "git merge @{-1}" in the above sequence would record the fact that the resulting commit is a merge of 'somelongtopicname', not literally "@{-1}", in its log message. It would be a sad regression if it suddenly starts to say "Merge branch '-'" [*1*], for example.

[Reference]
*1* https://public-inbox.org/git/xmqqinnsegxb.fsf@gitster.mtv.corp.google.com/
Previous: git@matthieu-moy.fr
Message 9 of 9 in “branch: implement shortcut to delete last branch”
  1. branch: implement shortcut to delete last branchAaron Greenberg, Mar 23, 2018
  2. branch: implement shortcut to delete last branchAaron Greenberg, Mar 23, 2018
  3. Jeff KingMar 23, 2018
  4. Jeff KingMar 23, 2018
  5. branch: implement shortcut to delete last branchAaron Greenberg, Mar 23, 2018
  6. branch: implement shortcut to delete last branchAaron Greenberg, Mar 23, 2018
  7. Jeff KingMar 26, 2018
  8. git@matthieu-moy.frMar 26, 2018
  9. Junio C HamanoMar 26, 2018

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.