diff options
author | Junio C Hamano <junkio@cox.net> | 2005-09-25 00:12:06 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-09-26 18:04:17 -0700 |
commit | deca7e8c591608c9ffd0bf0aaf10b379da9f6d6e (patch) | |
tree | 49b93d4d45cd52f4c05b1030d05b4b8329c5824a | |
parent | Do not require clean tree when reverting and cherry-picking. (diff) | |
download | tgif-deca7e8c591608c9ffd0bf0aaf10b379da9f6d6e.tar.xz |
Give default merge message after failed automerge.
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-x | git-commit.sh | 3 | ||||
-rwxr-xr-x | git-merge.sh | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/git-commit.sh b/git-commit.sh index d8bfc3c254..9412840d8f 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -141,6 +141,9 @@ t) esac if [ -f "$GIT_DIR/MERGE_HEAD" ]; then + + test -f "$GIT_DIR/MERGE_MSG" && cat "$GIT_DIR/MERGE_MSG" + echo "#" echo "# It looks like your may be committing a MERGE." echo "# If this is not correct, please remove the file" diff --git a/git-merge.sh b/git-merge.sh index 413bfcae9f..7607e819c3 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -19,7 +19,7 @@ default_strategies='resolve octopus' use_strategies= dropsave() { - rm -f -- "$GIT_DIR/MERGE_HEAD" \ + rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \ "$GIT_DIR/MERGE_SAVE" || exit 1 } @@ -28,9 +28,12 @@ savestate() { } restorestate() { - git reset --hard $head - cpio -iuv <"$GIT_DIR/MERGE_SAVE" - git-update-index --refresh >/dev/null + if test -f "$GIT_DIR/MERGE_SAVE" + then + git reset --hard $head + cpio -iuv <"$GIT_DIR/MERGE_SAVE" + git-update-index --refresh >/dev/null + fi } summary() { @@ -160,6 +163,7 @@ case "$use_strategies" in single_strategy=no ;; *) + rm -f "$GIT_DIR/MERGE_SAVE" single_strategy=yes ;; esac @@ -242,4 +246,6 @@ for remote do echo $remote done >"$GIT_DIR/MERGE_HEAD" +echo $merge_msg >"$GIT_DIR/MERGE_MSG" + die "Automatic merge failed; fix up by hand" |