From: Tom Clarkson <tom@xxxxxxxxxxxxxx> Adds an entry to the subtree cache so that subsequent split runs can skip any commits that turn out to be problematic. Signed-off-by: Tom Clarkson <tom@xxxxxxxxxxxxxx> --- contrib/subtree/git-subtree.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index 90f92f4e949..f8ae1283cd3 100755 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@ -15,6 +15,7 @@ git subtree merge --prefix=<prefix> <commit> git subtree pull --prefix=<prefix> <repository> <ref> git subtree push --prefix=<prefix> <repository> <ref> git subtree split --prefix=<prefix> <commit> +git subtree map --prefix=<prefix> <mainline> <subtree> -- h,help show the help q quiet @@ -161,7 +162,7 @@ command="$1" shift case "$command" in -add|merge|pull) +add|merge|pull|map) default= ;; split|push) @@ -192,7 +193,8 @@ dir="$(dirname "$prefix/.")" if test "$command" != "pull" && test "$command" != "add" && - test "$command" != "push" + test "$command" != "push" && + test "$command" != "map" then revs=$(git rev-parse $default --revs-only "$@") || exit $? dirs=$(git rev-parse --no-revs --no-flags "$@") || exit $? @@ -795,6 +797,21 @@ cmd_add_commit () { say "Added dir '$dir'" } +cmd_map () { + oldrev="$1" + newrev="$2" + + if test -z "$oldrev" + then + die "You must provide a revision to map" + fi + + cache_setup || exit $? + cache_set "$oldrev" "$newrev" + + say "Mapped $oldrev => $newrev" +} + cmd_split () { debug "Splitting $dir..." cache_setup || exit $? -- gitgitgadget