From: Sebastian Schuberth <sschuberth@gmail.com>
To: git@vger.kernel.org
Subject: Most reliable method to detect a merge commit in pre-commit hook
Date: Tue, 24 Jan 2012 15:16:40 +0100 [thread overview]
Message-ID: <jfmegi$scg$1@dough.gmane.org> (raw)
Hi,
I'd like our pre-commit hook to skip some checks if the commit that's
about to be made is a merge commit. What's the most reliable way to
detect a merge commit from within a pre-commit hook script? Currently,
the only way I see is to check whether .git/MERGE_MSG exists, but I'd
feel safer to check whether the commit is going to have more than one
parent or so. Is that possible / a better detection?
--
Sebastian Schuberth
next reply other threads:[~2012-01-24 14:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 14:16 Sebastian Schuberth [this message]
2012-01-24 15:10 ` Most reliable method to detect a merge commit in pre-commit hook Stefan Haller
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='jfmegi$scg$1@dough.gmane.org' \
--to=sschuberth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.