summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8e79043)
raw | patch | inline | side by side (parent: 8e79043)
author | Avery Pennarun <apenwarr@gmail.com> | |
Sat, 30 May 2009 05:28:20 +0000 (01:28 -0400) | ||
committer | Avery Pennarun <apenwarr@gmail.com> | |
Sat, 30 May 2009 05:51:38 +0000 (01:51 -0400) |
git-subtree.sh | patch | blob | history |
diff --git a/git-subtree.sh b/git-subtree.sh
index 65b6348fe455e93f750787c2136b11e6d0526b99..d82e03e6fd295d575ac23624a87f0e41145f4f40 100755 (executable)
--- a/git-subtree.sh
+++ b/git-subtree.sh
case "$a" in
git-subtree-mainline:) main="$b" ;;
git-subtree-split:) sub="$b" ;;
- *)
+ END)
if [ -n "$main" -a -n "$sub" ]; then
debug " Prior: $main -> $sub"
cache_set $main $sub
try_remove_previous "$main"
try_remove_previous "$sub"
- main=
- sub=
fi
+ main=
+ sub=
;;
esac
done
EOF
}
-merge_msg()
+rejoin_msg()
{
dir="$1"
latest_old="$2"
tree=$(subtree_for_commit $rev "$dir")
debug " tree is: $tree"
+
+ # ugly. is there no better way to tell if this is a subtree
+ # vs. a mainline commit? Does it matter?
[ -z $tree ] && continue
newrev=$(copy_or_skip "$rev" "$tree" "$newparents") || exit $?
debug "Merging split branch into HEAD..."
latest_old=$(cache_get latest_old)
git merge -s ours \
- -m "$(merge_msg $dir $latest_old $latest_new)" \
+ -m "$(rejoin_msg $dir $latest_old $latest_new)" \
$latest_new >&2 || exit $?
fi
if [ -n "$branch" ]; then