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

Re: [PATCH GSoC] Allow "-" as a short-hand for "@{-1}" in branch deletions

From
SSShuyang Shi <shuyang790@gmail.com>
Date
Mar 10, 2017, 06:07 UTC
Message-ID
<CAE9=6bpVs5bqTgzt1uLDYsF2-Mtx3mgfEZB_ag2VzMg7MmmwYQ@mail.gmail.com>
In-Reply-To
<20170310033058.GA1984@instance-1.c.mfqp-source.internal>
Hey Siddharth,

It is good to know that you have been working on this, and sorry for this "bump". Although I see "git branch -d -" not so dangerous, it is okay for me that we keep it out of the shorthand range.

And your work is awesome.
Thanks,
Shuyang
史舒扬 Shuyang Shi
Undergraduate
Department of CS, School of EECS, Peking University
Email: shuyang790@gmail.com
Mobile: +86-18301336991

On Fri, Mar 10, 2017 at 11:30 AM, Siddharth Kannan <kannan.siddharth12@gmail.com> wrote:

Show 28 quoted lines
> Hey Shuyang,
> On Thu, Mar 09, 2017 at 09:47:12AM -0800, Stefan Beller wrote:
>> > The "-" shorthand that stands for "the branch we were previously on",
>> > like we did for "git merge -" sometime after we introduced "git checkout -".
>> > Now I am introducing this shorthand to branch delete, i.e.
>> > "git branch -d -".
>> >
>> > More reference:
>> >   https://public-inbox.org/git/7vppuewl6h.fsf@alter.siamese.dyndns.org/
>>
>
> 1. I have already worked on this project, and my patch is in the
> "Needs review" section in "What's cooking". It implements this change
> inside sha1_name.c and doesn't touch git branch. So, your patch is
> mutually exclusive to my previous patch.
>
> 2. Matthieu made an argument against enabling commands like "git
> branch -D -" even by mistake [1]. The way that I have implemented
> ensured that not a lot of "rm"-like commands were enabled.
>
> My patch that would enable this shorthand for other projects is
> here[2].
>
> [1]: http://public-inbox.org/git/vpqh944eof7.fsf@anie.imag.fr/
> [2]: http://public-inbox.org/git/1488007487-12965-5-git-send-email-kannan.siddharth12@gmail.com/
>
> Thanks,
> Siddharth.
Previous: Siddharth Kannan
Message 6 of 6 in “Allow "-" as a short-hand for "@{-1}" in branch deletions”
  1. Allow "-" as a short-hand for "@{-1}" in branch deletionsShuyang Shi, Mar 9, 2017
  2. Allow "-" as a short-hand for "@{-1}" in branch deletionsShuyang Shi, Mar 9, 2017
  3. Stefan BellerMar 9, 2017
  4. Shuyang ShiMar 10, 2017
  5. Siddharth KannanMar 10, 2017
  6. Shuyang ShiMar 10, 2017

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.