summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorNanako Shiraishi <nanako3@lavabit.com>2008-10-06 14:14:29 +0900
committerShawn O. Pearce <spearce@spearce.org>2008-10-06 09:00:56 -0700
commitc44276563f96bba7133e3ee4144b7e0364d499b9 (patch)
treec0ef7c3b6a31e0e88cd9f7b54daee536d13215ec /git-rebase.sh
parent276328ffb87cefdc515bee5f09916aea6e0244ed (diff)
downloadgit-c44276563f96bba7133e3ee4144b7e0364d499b9.tar.gz
rebase --no-verify
It is sometimes desirable to disable the safety net of pre-rebase hook when the user knows what he is doing (for example, when the original changes on the branch have not been shown to the public yet). This teaches --no-verify option to git-rebase, which is similar to the way pre-commit hook is bypassed by git-commit. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index a30d40c005..f2742aa054 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -34,6 +34,7 @@ set_reflog_action rebase
require_work_tree
cd_to_toplevel
+OK_TO_SKIP_PRE_REBASE=
RESOLVEMSG="
When you have resolved this problem run \"git rebase --continue\".
If you would prefer to skip this patch, instead run \"git rebase --skip\".
@@ -145,7 +146,8 @@ is_interactive () {
}
run_pre_rebase_hook () {
- if test -x "$GIT_DIR/hooks/pre-rebase"
+ if test -z "$OK_TO_SKIP_PRE_REBASE" &&
+ test -x "$GIT_DIR/hooks/pre-rebase"
then
"$GIT_DIR/hooks/pre-rebase" ${1+"$@"} || {
echo >&2 "The pre-rebase hook refused to rebase."
@@ -170,6 +172,9 @@ fi
while test $# != 0
do
case "$1" in
+ --no-verify)
+ OK_TO_SKIP_PRE_REBASE=yes
+ ;;
--continue)
test -d "$dotest" -o -d "$GIT_DIR"/rebase-apply ||
die "No rebase in progress?"