From: Wincent Colaiuta <win@wincent.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, krh@redhat.com, Wincent Colaiuta <win@wincent.com>
Subject: [PATCH 1/3] Allow --no-verify to bypass commit-msg hook
Date: Sat, 8 Dec 2007 12:38:07 +0100 [thread overview]
Message-ID: <1197113889-16243-2-git-send-email-win@wincent.com> (raw)
In-Reply-To: <1197113889-16243-1-git-send-email-win@wincent.com>
At the moment the --no-verify switch to "git commit" instructs it to
skip over the pre-commit hook. Here we teach "git commit --no-verify"
to skip over the commit-msg hook as well. This brings the behaviour
of builtin-commit back in line with git-commit.sh.
Signed-off-by: Wincent Colaiuta <win@wincent.com>
---
builtin-commit.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 2ec8223..df9377e 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -791,7 +791,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
rollback_index_files();
die("could not read commit message");
}
- if (run_hook(index_file, "commit-msg", git_path(commit_editmsg))) {
+ if (!no_verify &&
+ run_hook(index_file, "commit-msg", git_path(commit_editmsg))) {
rollback_index_files();
exit(1);
}
--
1.5.3.7.1115.gaa595
next prev parent reply other threads:[~2007-12-08 11:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-08 11:38 [PATCH 0/3] builtin-commit fixes Wincent Colaiuta
2007-12-08 11:38 ` Wincent Colaiuta [this message]
2007-12-08 11:38 ` [PATCH 2/3] Documentation: fix --no-verify documentation for "git commit" Wincent Colaiuta
2007-12-08 11:38 ` [PATCH 3/3] Fix commit-msg hook to allow editing Wincent Colaiuta
2007-12-09 7:21 ` Junio C Hamano
2007-12-09 12:22 ` Wincent Colaiuta
2007-12-08 12:29 ` [PATCH 4/4] Add tests for pre-commit and commit-msg hooks Wincent Colaiuta
2007-12-08 12:51 ` Wincent Colaiuta
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=1197113889-16243-2-git-send-email-win@wincent.com \
--to=win@wincent.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=krh@redhat.com \
/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).