git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marvin Fraeman" <marvin.fraeman@gmail.com>
To: git@vger.kernel.org
Subject: How do I control the automated commit message on a merge?
Date: Tue, 3 Jun 2008 14:55:10 -0700	[thread overview]
Message-ID: <bd2cb52a0806031455r151303achf0424b5320bf2f07@mail.gmail.com> (raw)

I am using git-svn. The SVN repository I'm dealing with has a standard
comment convention I must follow. It is a simple static string of
information that must appear on the first line of the commit message.
Everything else can be free-form.

I figured out how to add a commit template to my gitconfig file. So
for regular commits, I think I'm fine. But when Git does a merge (no
conflicts), it auto-generates a commit message like:

        Merge branch 'master' of  /path/to/other/repo

How can I change this so my required string gets written at the
beginning of the commit message. I played with the commit-msg and
prepare-commit-msg hooks, but it didn't seem to get triggered in the
merge case.

Also, having the prepare-commit-msg hook add text had the side-effect
that in my normal commits, the message was always accepted, even when
I wanted to abort (vi using :q!). In case I ever do need to use
prepare-commit-msg, is there a way I can use it where abort still can
work?


Thank you

             reply	other threads:[~2008-06-03 21:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 21:55 Marvin Fraeman [this message]
2008-06-03 22:51 ` How do I control the automated commit message on a merge? Johannes Schindelin
2008-06-04  0:05   ` Marvin Fraeman
2008-06-04  7:33     ` Stephan Beyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bd2cb52a0806031455r151303achf0424b5320bf2f07@mail.gmail.com \
    --to=marvin.fraeman@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).