Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Added a --onto option, but it's so complicated I can't tell if it works.
author
Avery Pennarun
<apenwarr@gmail.com>
Fri, 24 Apr 2009 21:05:14 +0000
(17:05 -0400)
committer
Avery Pennarun
<apenwarr@gmail.com>
Fri, 24 Apr 2009 21:05:14 +0000
(17:05 -0400)
git-subtree.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
8b4a77f
)
diff --git
a/git-subtree.sh
b/git-subtree.sh
index af1d332e24782b3afb374a46c735235027d38bfd..7e1707ae2afadacc6706731423ab28f06aa9f9d6 100755
(executable)
--- a/
git-subtree.sh
+++ b/
git-subtree.sh
@@
-13,7
+13,7
@@
git subtree does foo and bar!
h,help show the help
q quiet
v verbose
h,help show the help
q quiet
v verbose
-onto= existing subtree revision to
connect, if any
+onto= existing subtree revision to
search for parent
rejoin merge the new branch back into HEAD
"
eval $(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)
rejoin merge the new branch back into HEAD
"
eval $(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)
@@
-172,6
+172,16
@@
cmd_split()
debug "Splitting $dir..."
cache_setup || exit $?
debug "Splitting $dir..."
cache_setup || exit $?
+ if [ -n "$onto" ]; then
+ echo "Reading history for $onto..."
+ git rev-list $onto |
+ while read rev; do
+ # the 'onto' history is already just the subdir, so
+ # any parent we find there can be used verbatim
+ cache_set $rev $rev
+ done
+ fi
+
unrevs="$(find_existing_splits "$dir" "$revs")"
git rev-list --reverse --parents $revs $unrevs -- "$dir" |
unrevs="$(find_existing_splits "$dir" "$revs")"
git rev-list --reverse --parents $revs $unrevs -- "$dir" |