summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9abaa7f)
raw | patch | inline | side by side (parent: 9abaa7f)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 16 Dec 2006 20:31:45 +0000 (12:31 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 16 Dec 2006 20:31:45 +0000 (12:31 -0800) |
This hacks the input to fmt-merge-msg to make the message for
merging early part of a branch a little easier to read.
Signed-off-by: Junio C Hamano <junkio@cox.net>
merging early part of a branch a little easier to read.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-merge.sh | patch | blob | history |
diff --git a/git-merge.sh b/git-merge.sh
index c895a04f6be0e09670af71532558abe994369a64..4ebfcf65d99f7743048df901b38969c28cc11edb 100755 (executable)
--- a/git-merge.sh
+++ b/git-merge.sh
esac
}
+merge_name () {
+ remote="$1"
+ rh=$(git-rev-parse --verify "$remote^0" 2>/dev/null) || return
+ bh=$(git-show-ref -s --verify "refs/heads/$remote" 2>/dev/null)
+ if test "$rh" = "$bh"
+ then
+ echo "$rh branch '$remote' of ."
+ elif truname=$(expr "$remote" : '\(.*\)~[1-9][0-9]*$') &&
+ git-show-ref -q --verify "refs/heads/$truname" 2>/dev/null
+ then
+ echo "$rh branch '$truname' (early part) of ."
+ else
+ echo "$rh commit '$remote'"
+ fi
+}
+
case "$#" in 0) usage ;; esac
rloga= have_message=
# in this loop.
merge_name=$(for remote
do
- rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null) ||
- continue ;# not something we can merge
- bh=$(git show-ref -s --verify "refs/heads/$remote" 2>/dev/null)
- if test "$rh" = "$bh"
- then
- echo "$rh branch '$remote' of ."
- else
- echo "$rh commit '$remote'"
- fi
+ merge_name "$remote"
done | git-fmt-merge-msg
)
merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name"