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

Re: [PATCH 01/10] fmt-merge-msg: also suppress "into main" by default

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 21, 2020, 22:12 UTC
Message-ID
<xmqq7drj5iux.fsf@gitster.c.googlers.com>
In-Reply-To
<cf950c6f6a48f9a6ad55ac027afbc0640f9a535d.1603135902.git.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> In preparation for changing the default branch name to `main`, let's
> skip the suffix "into main" in merge commit messages.

Hmph, we reversed the course from "no suppression" to "suppress master as we've always done" because otherwise we'd add _more_ instances of 6-letter string 'master' to our codebase, and that was to be avoided. There is no such "let's avoid saying main" desire, is there?

I can see why a series about updating tests would want a change like this (i.e. to avoid patches that have to add 'into main' everywhere to the expected output), but as to the desired behaviour of the default behaviour of "git merge" command, I am not sure this goes into the right direction. After all, there are those (including me) who find the idea of having one single thing (in this case a branch) that is special among others is objectionable in itself, not what word (e.g. 'master') is used to call that single "special" thing.

Having said all that, let me keep my suggested change to the very minimum. Let's end the proposed log message with

    ..., let's skip the suffix "into main" in merge commit messages,
    the same way that "into master" has been skipped by default.
That would justify why we are still special casing the new word.
Thanks.
Show 20 quoted lines
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  fmt-merge-msg.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fmt-merge-msg.c b/fmt-merge-msg.c
> index bd22e1ea88..9a664a4a58 100644
> --- a/fmt-merge-msg.c
> +++ b/fmt-merge-msg.c
> @@ -626,8 +626,10 @@ int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
>  	void *current_branch_to_free;
>  	struct merge_parents merge_parents;
>  
> -	if (!suppress_dest_pattern_seen)
> +	if (!suppress_dest_pattern_seen) {
> +		string_list_append(&suppress_dest_patterns, "main");
>  		string_list_append(&suppress_dest_patterns, "master");
> +	}
>  
>  	memset(&merge_parents, 0, sizeof(merge_parents));
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin
Message 3 of 35 in “Prepare for changing the default branch name main (last manual part)”
  1. 00/10 Prepare for changing the default branch name main (last manual part)Johannes Schindelin via GitGitGadget, Oct 19, 2020
  2. 01/10 fmt-merge-msg: also suppress "into main" by defaultJohannes Schindelin via GitGitGadget, Oct 19, 2020
  3. Junio C HamanoOct 21, 2020
  4. Johannes SchindelinOct 22, 2020
  5. 02/10 t9801: use `--` in preparation for default branch renameJohannes Schindelin via GitGitGadget, Oct 19, 2020
  6. Junio C HamanoOct 21, 2020
  7. 03/10 tests: start moving to a different default main branch nameJohannes Schindelin via GitGitGadget, Oct 19, 2020
  8. Junio C HamanoOct 21, 2020
  9. 05/10 t6200: adjust suppression pattern to also match "main"Johannes Schindelin via GitGitGadget, Oct 19, 2020
  10. Junio C HamanoOct 21, 2020
  11. Johannes SchindelinOct 22, 2020
  12. 06/10 t5703: adjust a test case for the upcoming default branch nameJohannes Schindelin via GitGitGadget, Oct 19, 2020
  13. Junio C HamanoOct 21, 2020
  14. 07/10 t3200: prepare for `main` being shorter than `master`Johannes Schindelin via GitGitGadget, Oct 19, 2020
  15. Junio C HamanoOct 21, 2020
  16. Johannes SchindelinOct 22, 2020
  17. 04/10 t4013: prepare for the new default branch name "main"Johannes Schindelin via GitGitGadget, Oct 19, 2020
  18. Junio C HamanoOct 21, 2020
  19. Johannes SchindelinOct 22, 2020
  20. 09/10 tests: prepare aligned mentions of the default branch nameJohannes Schindelin via GitGitGadget, Oct 19, 2020
  21. 08/10 t9902: prepare a test for the upcoming default branch nameJohannes Schindelin via GitGitGadget, Oct 19, 2020
  22. 10/10 t1400: prepare for `main` being default branch nameJohannes Schindelin via GitGitGadget, Oct 19, 2020
  23. Junio C HamanoOct 21, 2020
  24. Johannes SchindelinOct 22, 2020
  25. 0/9 Prepare for changing the default branch name main (last manual part)Johannes Schindelin via GitGitGadget, Oct 23, 2020
  26. 1/9 fmt-merge-msg: also suppress "into main" by defaultJohannes Schindelin via GitGitGadget, Oct 23, 2020
  27. 2/9 t9801: use `--` in preparation for default branch renameJohannes Schindelin via GitGitGadget, Oct 23, 2020
  28. 3/9 tests: start moving to a different default main branch nameJohannes Schindelin via GitGitGadget, Oct 23, 2020
  29. 4/9 t6200: adjust suppression pattern to also match "main"Johannes Schindelin via GitGitGadget, Oct 23, 2020
  30. 7/9 t9902: prepare a test for the upcoming default branch nameJohannes Schindelin via GitGitGadget, Oct 23, 2020
  31. 6/9 t3200: prepare for `main` being shorter than `master`Johannes Schindelin via GitGitGadget, Oct 23, 2020
  32. 5/9 t5703: adjust a test case for the upcoming default branch nameJohannes Schindelin via GitGitGadget, Oct 23, 2020
  33. 9/9 t1400: prepare for `main` being default branch nameJohannes Schindelin via GitGitGadget, Oct 23, 2020
  34. 8/9 tests: prepare aligned mentions of the default branch nameJohannes Schindelin via GitGitGadget, Oct 23, 2020
  35. Junio C HamanoOct 23, 2020

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.