-#!/bin/bash
+#!/bin/sh
no_build=false
start_from=""
done
shift $((OPTIND - 1))
-# shellcheck source=common.sh
-source "$(dirname "$0")/common.sh"
+. "$(dirname "$0")/common.sh"
log()
{
execute()
{
- log "$" "$@"
- "$@" 2>&1 | tee -a "$LOG_FILE"
- return "${PIPESTATUS[0]}"
+ log '$' "$@"
+ _out="$( "$@" 2>&1 )"
+ _err=$?
+ echo "$_out" | tee -a "$LOG_FILE"
+ return "$_err"
}
fix_up()
done 7<"../pre-merge/$tree"
fi
log Merging "$h" "($hlog)"
- printf -v msg "Merge branch '%s' of %s" "${h#*/}" "$(get_url "$tree")"
+ msg=$(printf "Merge branch '%s' of %s" "${h#*/}" "$(get_url "$tree")")
if ! execute git merge -m "$msg" "$h"; then
echo Merge failed 1>&2
echo "$h" >>../merge.debug
# fi
fi
- tab=$'\t'
+ tab="$_TAB"
if [ "${#tree}" -lt 8 ]; then
- tab=$'\t\t'
+ tab="$_TAB$_TAB"
fi
printf '%s%s%s\n' "$tree" "$tab" "$(git rev-parse "$h^{}")" >> "$SHA1_FILE"