author | Junio C Hamano <junkio@cox.net> | |
Mon, 26 Jun 2006 21:36:10 +0000 (14:36 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 26 Jun 2006 21:36:10 +0000 (14:36 -0700) |
* jc/squash:
git-merge --squash
git-merge --squash
1 | 2 | |||
---|---|---|---|---|
git-commit.sh | patch | | diff1 | | diff2 | | blob | history |
diff --combined git-commit.sh
index 128db6c52a878a421a67c658dfd175f774c24fea,9f49651cfdce101af3ba2c1980121d9ccea8a194..d7f3ade493762140c9a5a888ac67f8435e737f10
--- 1/git-commit.sh
--- 2/git-commit.sh
+++ b/git-commit.sh
elif test -f "$GIT_DIR/MERGE_HEAD" && test -f "$GIT_DIR/MERGE_MSG"
then
cat "$GIT_DIR/MERGE_MSG"
+ elif test -f "$GIT_DIR/SQUASH_MSG"
+ then
+ cat "$GIT_DIR/SQUASH_MSG"
fi | git-stripspace >"$GIT_DIR"/COMMIT_EDITMSG
case "$signoff" in
fi
if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
then
- rm -f "$GIT_DIR/COMMIT_EDITMSG"
+ rm -f "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
run_status
exit 1
fi
fi
esac
-sed -e '
- /^diff --git a\/.*/{
- s///
- q
- }
- /^#/d
-' "$GIT_DIR"/COMMIT_EDITMSG |
+if test -z "$no_edit"
+then
+ sed -e '
+ /^diff --git a\/.*/{
+ s///
+ q
+ }
+ /^#/d
+ ' "$GIT_DIR"/COMMIT_EDITMSG
+else
+ cat "$GIT_DIR"/COMMIT_EDITMSG
+fi |
git-stripspace >"$GIT_DIR"/COMMIT_MSG
if cnt=`grep -v -i '^Signed-off-by' "$GIT_DIR"/COMMIT_MSG |
false
fi
ret="$?"
- rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG"
+ rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
if test -d "$GIT_DIR/rr-cache"
then
git-rerere