Proposal: Allow Customization of Git Merge Commit Message Template

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux