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

Re: [PATCH] branch: error description when deleting a not fully merged branch

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 10, 2024, 21:46 UTC
Message-ID
<xmqqr0io980h.fsf@gitster.g>
In-Reply-To
<xmqqbk9tcc57.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 17 quoted lines
> This is probably one sensible step forward, so let's queue it as-is.
>
> But with reservations for longer-term future direction.  Stepping
> back a bit, when 'foo' is not fully merged and the user used "branch
> -d" on it, is it sensible for us to suggest use of "branch -D"?
>
> Especially now this is a "hint" to help less experienced folks, it
> may be helpful to suggest how the user can answer "If you are sure
> you want to delete" part.  As this knows what unique commits on the
> branch being deleted are about to be lost, one way to do so may be
> to tell the user about them ("you are about to lose 'branch: error
> description when deleting a not fully merged branch' and other 47
> commits that are not merged the target branch 'main'", for example).
>
> Another possibility is to suggest merging the branch into the
> target, instead of suggesting a destructive "deletion", but I
> suspect that it goes too far second-guessing the end-user intention.

The longer-term concerns aside, if you are inclined, we might want to have this as a two step series, where [1/2] does a clean-up of existing source file, i.e. losing the unwanted leading space from " enum advice_type {" in advice.h and sort the advice.*:: list in Documentation/config/advice.txt. It is optional to sort the advice_setting[] list in advice.c and "enum advice_type" in advice.h, as they are not end-user facing, and we should be using the defined constant without relying on their exact values. But keeping the config/advice.txt sorted would help readers more easily locate which configuration variable to use to squelch a message.

And [2/2] does the rest.
Also I forgot that in the version I queued, I fixed the title to
    branch: make the advice to force-deleting a conditional one
Thanks.
Previous: Junio C HamanoNext: Rubén Justo
Message 3 of 12 in “branch: error description when deleting a not fully merged branch”
  1. branch: error description when deleting a not fully merged branchRubén Justo, Jan 10, 2024
  2. Junio C HamanoJan 10, 2024
  3. Junio C HamanoJan 10, 2024
  4. Rubén JustoJan 11, 2024
  5. 0/3 branch: error description when deleting a not fully merged branchRubén Justo, Jan 11, 2024
  6. 1/3 advice: sort the advice related listsRubén Justo, Jan 11, 2024
  7. 2/3 advice: fix an unexpected leading spaceRubén Justo, Jan 11, 2024
  8. Junio C HamanoJan 12, 2024
  9. Rubén JustoJan 12, 2024
  10. Junio C HamanoJan 12, 2024
  11. Junio C HamanoJan 12, 2024
  12. 3/3 branch: make the advice to force-deleting a conditional oneRubén Justo, Jan 11, 2024

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.