4 if [ "X$1" = 'X-b' ]; then
11 tools_dir=$(dirname "$0")
16 cformat='%(trailers:only=no,valueonly,unfold,key=signed-off-by)%aN <%aE>%n%cN <%cE>'
18 read -r -a head_commits -p 'HEAD commit(s): '
19 for c in "${head_commits[@]}"; do
20 if ! git rev-parse --verify "$c" >/dev/null; then
21 printf 'Unknown commit %s\n' "$c"
24 hc+=( "$(git log -1 --format='%h ("%s")' "$c")" )
25 readarray -t -O "${#cc[@]}" cc < <(git log -1 --format="$cformat" "$c" | sort -u)
28 if [ "${#hc[@]}" -gt 1 ]; then
32 read -r -a head_branches -p 'HEAD branch(es): '
34 hb=( "${head_branches[@]/%/,}" )
36 if [ "${#hb[@]}" -gt 2 ]; then
37 hb[-2]=${hb[-2]/%,/ and}
40 if [ "${#hb[@]}" -gt 1 ]; then
44 printf -v subject 'manual merge of the BRANCH tree with the %s tree%s' \
47 read -r -a merge_commits -p 'MERGE_HEAD commit(s): '
48 for c in "${merge_commits[@]}"; do
49 if ! git rev-parse --verify "$c" >/dev/null; then
50 printf 'Unknown commit %s\n' "$c"
53 mc+=( "$(git log -1 --format='%h ("%s")' "$c")" )
54 readarray -t -O "${#cc[@]}" cc < <(git log -1 --format="$cformat" "$c" | sort -u)
57 if [ "${#mc[@]}" -gt 1 ]; then
61 printf -v files ' %s\n' "$@"
63 if [ "$#" -gt 1 ]; then
67 "$tools_dir/message_helper" "${branch[@]}" "$subject" "${cc[@]}" <<EOF
68 FIXME: Add owner of second tree to To:
69 Add author(s)/SOB of conflicting commits.
71 Today's linux-next merge of the BRANCH tree got $conf in:
76 $(printf ' %s\n' "${hc[@]}")
78 from the ${hb[*]} tree$hbs and commit$mcs:
80 $(printf ' %s\n' "${mc[@]}")
84 I fixed it up (see below) and can carry the fix as necessary. This
85 is now fixed as far as linux-next is concerned, but any non trivial
86 conflicts should be mentioned to your upstream maintainer when your tree
87 is submitted for merging. You may also want to consider cooperating
88 with the maintainer of the conflicting tree to minimise any particularly