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

Proposal: Allow Customization of Git Merge Commit Message Template

From
D.dangling . <kasperkantz@outlook.com>
Date
Dec 5, 2024, 17:00 UTC
Message-ID
<DM4PR14MB4880061D71993B749F44F2EDA7302@DM4PR14MB4880.namprd14.prod.outlook.com>
Hello Git mailing list,
I’d like to propose a feature to allow users to modify the default merge commit message template generated by `git merge`. Currently, when running:

``` git merge --no-ff upstream/main ```

Git produces a message like: ```sh Merge remote-tracking branch 'upstream/main' into my-branch ```

While informative, this message can be verbose and sometimes makes branch names difficult to fit within the recommended 52-character first line. Personally, I find a simplified format like this more concise and effective: ```sh Merge upstream/main into my-branch ```

Proposal: Introduce an option (e.g., a configuration setting or CLI flag) that allows users to specify a custom merge commit message template. For example:

- A new configuration option:
  ```sh
  [merge]
      messageTemplate = "Merge %s into %s"
  ```
  Here, `%s` placeholders could represent the source and destination branches, respectively.
- Alternatively, a command-line flag:
  ```sh
  git merge --message-template="Merge %s into %s" upstream/main
  ```
Looking forward to your thoughts.
/k
Next: brian m. carlson
Message 1 of 2 in “Proposal: Allow Customization of Git Merge Commit Message Template”
  1. dangling .Dec 5, 2024
  2. brian m. carlsonDec 5, 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.