git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <gitster@pobox.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: [PATCH 1/2] Avoid update hook during git-rebase --interactive
Date: Wed, 19 Dec 2007 01:41:26 -0500	[thread overview]
Message-ID: <20071219064125.GA8915@spearce.org> (raw)

If we are rebasing changes that contain potential whitespace
errors that our .git/hooks/pre-commit hook looks for and fails
on then git-commit will fail to commit that change.  This causes
git-rebase--interactive to squash commits together, even though it
was not requested to do so by the todo file.

Passing --no-verify to git-commit makes git-rebase -i behave more
like git-rebase normally would in such conditions, providing more
consistent behavior between the different rebase implementations.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---

 This bug has bitten me more than once.  One could argue that the
 pre-commit hook should be running, to prevent you from rebasing a
 series that has crappy whitespace, but git-rebase without -m and
 without -i will let you rebase such a series without stopping you,
 as git-am doesn't execute the pre-commit hook.

 git-rebase--interactive.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index cd7e43f..b846ea8 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -296,7 +296,7 @@ do_next () {
 			GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
 			GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
 			GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
-			$USE_OUTPUT git commit -F "$MSG" $EDIT_COMMIT
+			$USE_OUTPUT git commit --no-verify -F "$MSG" $EDIT_COMMIT
 			;;
 		t)
 			cp "$MSG" "$GIT_DIR"/MERGE_MSG
@@ -372,7 +372,7 @@ do
 			test ! -f "$DOTEST"/amend || git reset --soft HEAD^
 		} &&
 		export GIT_AUTHOR_NAME GIT_AUTHOR_NAME GIT_AUTHOR_DATE &&
-		git commit -F "$DOTEST"/message -e
+		git commit --no-verify -F "$DOTEST"/message -e
 
 		require_clean_work_tree
 		do_rest
-- 
1.5.4.rc0.1155.g12ed9

                 reply	other threads:[~2007-12-19  6:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20071219064125.GA8915@spearce.org \
    --to=spearce@spearce.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).