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

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

From
Stefan Beller <sbeller@google.com>
Date
Mar 21, 2016, 19:27 UTC
Message-ID
<CAGZ79kbmMAyd3rDokCD6RSLuoJDKfPG0m2+HszUuRYG_eHdC6A@mail.gmail.com>
In-Reply-To
<CAPig+cQ-kmHeQsMMKdj0joSHWEnGfirSM1WbC-6G2BiMLnoUGg@mail.gmail.com>
On Mon, Mar 21, 2016 at 12:14 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 17 quoted lines
> [please don't top-post; respond inline instead]
>
> On Mon, Mar 21, 2016 at 2:53 PM, elena petrashen
> <elena.petrashen@gmail.com> wrote:
>> 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.)
There is some advice, but it is not spelled out for beginners IMO
    Deleted branch test_branch (was c62f9fe).

I would assume intermediate Git users would know c62f9fe to be a sha1 which can be used to retrieve the content of the deleted branch. It is a good idea nevertheless to add

    To recover the branch: "git branch test_branch c62f9fe

I would not even make it configurable to suppress it as it is just 2 more lines.

Thanks, Stefan

Show 11 quoted lines
>
>> 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.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Eric Sunshine
Message 8 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.