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

Re: Prompt for merge message?

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 6, 2011, 22:02 UTC
Message-ID
<7vsjn5ye0x.fsf@alter.siamese.dyndns.org>
In-Reply-To
<6eb7acc7-f4be-4b90-a2fa-a0c91ed9a5a8@t11g2000yqk.googlegroups.com>
"Todd A. Jacobs" <nospam+listmail@codegnome.org> writes:
Show 8 quoted lines
> I often find myself using "--no-ff -m foo" for merging short-lived
> branches, because the merge commit usually needs to say something
> about having finished a feature rather than referring to a branch that
> will be deleted shortly anyway....
> ... Is there currently a way to get git to prompt for the merge message,
> rather than using the default or requiring the -m flag? If not, isn't
> this a common-enough use case to have that ability added to the merge
> function?

Others commented on the current practices and gave their own useful tips already, but an additional hint is to name your branch more sensibly, so that you do not feel it is useless to record it in the history.

As to a real longer-term solution, I wouldn't mind a patch that teaches "git merge" an "-e" option just like "git commit" has.

    $ git commit -m "Finish frotz feature" -e -a
    ... editor opens with the first line filled already here ...
is something I find myself using fairly often.
Thanks.
[offtopic: It is annoying that my MUA warns me
    "nospam+listmail@domain" may be bogus; do you really want to send?
Could you do something about it please?]
Previous: Andreas KreyNext: Shawn Pearce
Message 6 of 10 in “Prompt for merge message?”
  1. Todd A. JacobsOct 6, 2011
  2. Jacob HelwigOct 6, 2011
  3. in-gitvger@baka.orgOct 6, 2011
  4. Stephen BashOct 6, 2011
  5. Andreas KreyOct 6, 2011
  6. Junio C HamanoOct 6, 2011
  7. Shawn PearceOct 6, 2011
  8. Junio C HamanoOct 6, 2011
  9. Todd A. JacobsOct 7, 2011
  10. Junio C HamanoOct 7, 2011

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.