verbose git checkout -b "$branch" "$b"
verbose git config "branch.$branch.remote" "$remote"
verbose git config "branch.$branch.merge" "refs/heads/$branch"
- verbose git push origin "$branch"
fi
fi
cd "$d0"
fi
fi
rem=`git config "branch.$r.remote" || echo origin`
- if { git log "$rem/$r".."$r" || git log origin/"`repobranch "$d"`".."$r"; } | grep .; then
+ bra=`git config "branch.$r.merge" || echo "$r"`
+ upstream="$rem/$bra"
+ if ! [ git rev-parse "$upstream" ]; then
+ upstream="`repobranch "$d"`"
+ fi
+ if git log "$upstream".."$r" | grep .; then
if yesno "Push \"$r\" in $dv?"; then
verbose git push "$rem" HEAD
fi
if [ x"$submit" = x"-s" ]; then
case "$r" in
*/*)
- verbose git push "$rem" HEAD:"${r%%/*}/finished/${r#*/}"
+ verbose git push "$rem" HEAD:"${bra%%/*}/finished/${bra#*/}"
;;
esac
fi
}
for d in $repos; do
enter "$d0/$d" verbose
+ base="`repobranch "$d"`"
reportecho "In $d:"
for ref in `git for-each-ref --format='%(refname)' refs/remotes/origin/`; do
case "${ref#refs/remotes/origin/}" in
- "`repobranch "$d"`")
+ "$base")
continue
;;
HEAD|master)
if [ -n "$note" ]; then
reportdo4 echo "$note"
reportecho4 "--> not merging, already had this one rejected before"
- elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ git log --color master.."$ref"; git diff --color --find-copies-harder --ignore-space-change master..."$ref"; } | less -r'; then
- git checkout master
+ elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ git log --color "$base".."$ref"; git diff --color --find-copies-harder --ignore-space-change "$base"..."$ref"; } | less -r'; then
+ git checkout "$base"
org=`git rev-parse HEAD`
if ! git merge "$ref" 2>&1 | tee "$t"; then
git reset --hard "$org"
else
case ",`repoflags "$d"`," in
*,svn,*)
- git pull
- git rebase -i "$org"
+ # we do quite a mess here... luckily we know $org
+ git pull # svn needs to be current
+ git rebase -i --onto master "$org"
git svn dcommit --add-author-from
+ git reset --hard "$org"
;;
*)
git push origin HEAD