diff options
-rwxr-xr-x | git-am.sh | 6 | ||||
-rwxr-xr-x | git-merge.sh | 17 | ||||
-rwxr-xr-x | git-pull.sh | 3 | ||||
-rwxr-xr-x | git-quiltimport.sh | 2 | ||||
-rwxr-xr-x | git-rebase.sh | 9 | ||||
-rwxr-xr-x | git-resolve.sh | 7 |
6 files changed, 33 insertions, 11 deletions
@@ -91,6 +91,7 @@ fall_back_3way () { } prec=4 +rloga=am dotest=.dotest sign= utf8= keep= skip= interactive= resolved= binary= ws= resolvemsg= while case "$#" in 0) break;; esac @@ -130,6 +131,9 @@ do --resolvemsg=*) resolvemsg=$(echo "$1" | sed -e "s/^--resolvemsg=//"); shift ;; + --reflog-action=*) + rloga=`expr "z$1" : 'z-[^=]*=\(.*\)'`; shift ;; + --) shift; break ;; -*) @@ -413,7 +417,7 @@ do parent=$(git-rev-parse --verify HEAD) && commit=$(git-commit-tree $tree -p $parent <"$dotest/final-commit") && echo Committed: $commit && - git-update-ref -m "am: $SUBJECT" HEAD $commit $parent || + git-update-ref -m "$rloga: $SUBJECT" HEAD $commit $parent || stop_here $this if test -x "$GIT_DIR"/hooks/post-applypatch diff --git a/git-merge.sh b/git-merge.sh index 24e3b507ef..a9cfafb1df 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -58,7 +58,13 @@ squash_message () { } finish () { - test '' = "$2" || echo "$2" + if test '' = "$2" + then + rlogm="$rloga" + else + echo "$2" + rlogm="$rloga: $2" + fi case "$squash" in t) echo "Squash commit -- not updating HEAD" @@ -70,7 +76,7 @@ finish () { echo "No merge message -- not updating HEAD" ;; *) - git-update-ref HEAD "$1" "$head" || exit 1 + git-update-ref -m "$rlogm" HEAD "$1" "$head" || exit 1 ;; esac ;; @@ -88,6 +94,7 @@ finish () { esac } +rloga= while case "$#" in 0) break ;; esac do case "$1" in @@ -117,6 +124,9 @@ do die "available strategies are: $all_strategies" ;; esac ;; + --reflog-action=*) + rloga=`expr "z$1" : 'z-[^=]*=\(.*\)'` + ;; -*) usage ;; *) break ;; esac @@ -131,6 +141,7 @@ shift # All the rest are remote heads test "$#" = 0 && usage ;# we need at least one remote head. +test "$rloga" = '' && rloga="merge: $@" remoteheads= for remote @@ -316,7 +327,7 @@ if test '' != "$result_tree" then parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /') result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) || exit - finish "$result_commit" "Merge $result_commit, made by $wt_strategy." + finish "$result_commit" "Merge made by $wt_strategy." dropsave exit 0 fi diff --git a/git-pull.sh b/git-pull.sh index d337bf4da3..f380437997 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -102,5 +102,6 @@ case "$strategy_args" in esac merge_name=$(git-fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit -git-merge $no_summary $no_commit $squash $strategy_args \ +git-merge "--reflog-action=pull $*" \ + $no_summary $no_commit $squash $strategy_args \ "$merge_name" HEAD $merge_head diff --git a/git-quiltimport.sh b/git-quiltimport.sh index 364baff806..10135da3ac 100755 --- a/git-quiltimport.sh +++ b/git-quiltimport.sh @@ -112,7 +112,7 @@ for patch_name in $(cat "$QUILT_PATCHES/series" | grep -v '^#'); do git-apply --index -C1 "$tmp_patch" && tree=$(git-write-tree) && commit=$((echo "$SUBJECT"; echo; cat "$tmp_msg") | git-commit-tree $tree -p $commit) && - git-update-ref HEAD $commit || exit 4 + git-update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4 fi done rm -rf $tmp_dir || exit 5 diff --git a/git-rebase.sh b/git-rebase.sh index 1b9e986926..29028dd5fc 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -131,7 +131,8 @@ do finish_rb_merge exit fi - git am --resolved --3way --resolvemsg="$RESOLVEMSG" + git am --resolved --3way --resolvemsg="$RESOLVEMSG" \ + --reflog-action=rebase exit ;; --skip) @@ -150,7 +151,8 @@ do finish_rb_merge exit fi - git am -3 --skip --resolvemsg="$RESOLVEMSG" + git am -3 --skip --resolvemsg="$RESOLVEMSG" \ + --reflog-action=rebase exit ;; --abort) @@ -288,7 +290,8 @@ fi if test -z "$do_merge" then git-format-patch -k --stdout --full-index "$upstream"..ORIG_HEAD | - git am --binary -3 -k --resolvemsg="$RESOLVEMSG" + git am --binary -3 -k --resolvemsg="$RESOLVEMSG" \ + --reflog-action=rebase exit $? fi diff --git a/git-resolve.sh b/git-resolve.sh index 1c7aaefa25..a7bc680d90 100755 --- a/git-resolve.sh +++ b/git-resolve.sh @@ -15,6 +15,7 @@ dropheads() { head=$(git-rev-parse --verify "$1"^0) && merge=$(git-rev-parse --verify "$2"^0) && +merge_name="$2" && merge_msg="$3" || usage # @@ -43,7 +44,8 @@ case "$common" in "$head") echo "Updating from $head to $merge" git-read-tree -u -m $head $merge || exit 1 - git-update-ref HEAD "$merge" "$head" + git-update-ref -m "resolve $merge_name: Fast forward" \ + HEAD "$merge" "$head" git-diff-tree -p $head $merge | git-apply --stat dropheads exit 0 @@ -100,6 +102,7 @@ if [ $? -ne 0 ]; then fi result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree -p $head -p $merge) echo "Committed merge $result_commit" -git-update-ref HEAD "$result_commit" "$head" +git-update-ref -m "resolve $merge_name: In-index merge" \ + HEAD "$result_commit" "$head" git-diff-tree -p $head $result_commit | git-apply --stat dropheads |