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, 19:14 UTC
Message-ID
<CAPig+cQ-kmHeQsMMKdj0joSHWEnGfirSM1WbC-6G2BiMLnoUGg@mail.gmail.com>
In-Reply-To
<CAJPOeMediYQMwvgqhOquVh+KT61gdpUew9ernjuOYuf8By=hZQ@mail.gmail.com>
[please don't top-post; respond inline instead]

On Mon, Mar 21, 2016 at 2:53 PM, elena petrashen <elena.petrashen@gmail.com> wrote:

Show 5 quoted lines
> Thank you for the feedback!
> The safety concert is indeed a good point. Would it maybe make
> sense to request user to confirm this operation? I.e:
> $git delete -D -
> You've requested to delete "foo" branch. Proceed with deleting? y/n

Rather than requiring the user to stop and answer a question, an alternative would be to perform the deletion as requested but then give advice about how to recover if the wrong branch was deleted by mistake, much in the way advice is given when switching to a detached head. (And, the advice could be suppressed by an "advice" configuration variable similar to how other advice messages can be suppressed.)

> Also, do you think - shortcut is justifiable for $git branch -m when
> referring to the "old branch"?

It comes up once in a while that I've switched away from a branch and then decide I want to rename it, but it's infrequent enough that it's difficult to say if it would be generally useful.

Previous: Eric SunshineNext: Stefan Beller
Message 7 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.