heads=$(awk -F '\t' '
/^#/ { next; }
- $2=="git" { printf("%s/%s ", $3, $5); }
+ $2=="git" { printf("git/%s/%s ", $3, $5); }
$2=="branch" { printf("branch/%s ", $1); }
$2=="switch" { printf("switch/%s/%s ", $3, $4); }' "$CTRL_FILE")
need_build=false
for h in $heads; do
- tree=${h%%/*}
- branch=${h#"$tree"/}
+ op=${h%%/*}
+ args=${h#*/}
+ arg1=${args%%/*}
+ arg2=${args#*/}
if [ -n "$previous_tree" ]; then
- if [ "$tree" = "$previous_tree" ]; then
+ if [ "$op" = 'git' ] && [ "$arg1" = "$previous_tree" ]; then
previous_tree=''
fi
continue
elif [ -n "$start_from" ]; then
- if [ "$tree" = "$start_from" ]; then
+ if [ "$op" = 'git' ] && [ "$arg1" = "$start_from" ]; then
start_from=""
else
continue
fi
fi
- if [ "$tree" = "branch" ]; then
- git branch -f "$branch"
- linux-next-notify "update branch $branch"
+ if [ "$op" = "branch" ]; then
+ git branch -f "$arg1"
+ linux-next-notify "update branch $arg1"
continue
fi
- if [ "$tree" = 'switch' ]; then
- new_branch=${branch%%/*}
+ if [ "$op" = 'switch' ]; then
+ new_branch=$arg1
if [ "$new_branch" = 'master' ]; then
old_branch=$(git branch --show-current)
if ! [ "$old_branch" = 'master' ]; then
fi
fi
else
- base=${branch#"$new_branch"/}
+ base=$arg2
if ! git checkout -B "$new_branch" "$base"; then
fix_up "git checkout $new_branch failed"
fi
continue
fi
- h=${h%/}
+# $op == "git"
+
+ tree=$arg1
+ branch=$arg2
+ h="$tree${branch:+/$branch}"
hlog=$(git log -1 --oneline "$h") 2>/dev/null
old_head=$(git rev-parse HEAD)
if [ -f "../pre-merge/$tree" ]; then
fi
log Merging "$h" "($hlog)"
check_dups "$tree" HEAD "$h" | tee -a "$LOG_FILE"
- msg=$(printf "Merge branch '%s' of %s" "${h#*/}" "$(get_url "$tree")")
+ msg=$(printf "Merge branch '%s' of %s" "$branch" "$(get_url "$tree")")
if ! execute git merge -m "$msg" "$h"; then
echo Merge failed 1>&2
echo "$h" >>../merge.debug