- [ -f "../pre-merge/$tree" ] && {
- for p in $(cat "../pre-merge/$tree"); do
- "$bin_dir/do_patch" -n "$p" || {
- notify-send -u critical -t 0 "premerge patch failed"
- bash -i || exit
- }
- done
- }
- log Merging $h "($hlog)"
- case "$h" in
- *:*)
- do_rebase $h $tree
- ;;
- *)
- execute git merge $h || {
- echo Merge failed 1>&2
- echo $h >>../merge.debug
- git diff >>../merge.debug 2>&1
- um_files=$(git diff 2>&1 | sed -n 's/^\* Unmerged path //p')
- [ "$um_files" ] && [ -f "../merge-files/$tree" ] && {
- rm_files=$(grep -F "$um_files" "../merge-files/$tree")
- [ "$rm_files" ] &&
- "$bin_dir/do_rm" $rm_files
- }
- git diff 2>&1 | egrep -q '<<<<<|^\*' && {
- notify-send -t 0 -u critical "linux-next new conflict found merging $tree!"
- pushover "linux-next new conflict found merging $tree!"
- if [ -f "../merge-fixes/$tree" ]; then
- echo "Merge fixes exist for this tree:"
- cat "../merge-fixes/$tree"
- fi
- bash -i || exit
- }
-# [ "$(git status --porcelain)" ] && {
- GIT_EDITOR=: execute git commit -v -a || {
- notify-send -t 0 -u critical "linux-next commit failed for $tree!"
- pushover "linux-next commit failed for $tree!"
- bash -i || exit
- }
- execute git diff -M --stat --summary 'HEAD^..'
-# }
- }
- ;;
- esac
- [ -f "../merge-fixes/$tree" ] && {
- for p in $(cat "../merge-fixes/$tree"); do
- "$bin_dir/merge_fix" -n "$p" || {
- notify-send -t 0 -u critical "linux-next merge fix failed for $tree!"
- pushover "linux-next merge fix failed for $tree!"
- bash -i || exit
- }
- done
- }
- tab="\t"
- [ $(echo "$tree" | wc -c) -le 8 ] && tab="\t\t"
- printf "%s$tab%s\n" $tree $(git rev-parse "${h/\/*://}") >> $SHA1_FILE
- $no_build && continue
- $need_build || {
+ if [ -f "../pre-merge/$tree" ]; then
+ while read -r p <&7; do
+ if ! "$bin_dir/do_patch" -n "$p"; then
+ fix_up "premerge patch failed"
+ fi 7<&-
+ done 7<"../pre-merge/$tree"
+ fi
+ log Merging "$h" "($hlog)"
+ if ! execute git merge "$h"; then
+ echo Merge failed 1>&2
+ echo "$h" >>../merge.debug
+ git diff >>../merge.debug 2>&1
+
+ check_unmerged_files "$tree"
+
+ if git diff 2>&1 | grep -E -q '<<<<<|^\*'; then
+ if [ -f "../merge-fixes/$tree" ]; then
+ echo "Merge fixes exist for this tree:"
+ cat "../merge-fixes/$tree"
+ fi
+ fix_up "new conflict found merging $tree"
+ fi
+# if [ "$(git status --porcelain)" ]; then
+ if ! execute git commit --no-edit -v -a; then
+ fix_up "next commit failed for $tree"
+ fi
+ execute git diff -M --stat --summary 'HEAD^..'
+# fi
+ fi
+ if [ -f "../merge-fixes/$tree" ]; then
+ while read -r p <&7; do
+ if ! "$bin_dir/merge_fix" -n "$p"; then
+ fix_up "merge fix failed for $tree"
+ fi 7<&-
+ done 7<"../merge-fixes/$tree"
+ fi
+
+ tab=$'\t'
+ if [ "${#tree}" -le 8 ]; then
+ tab=$'\t\t'
+ fi
+ printf '%s%s%s\n' "$tree" "$tab" "$(git rev-parse "$h^{}")" >> "$SHA1_FILE"
+
+ if $no_build; then
+ continue
+ fi
+
+ if ! $need_build; then