path: root/contrib/subtree/
diff options
authorLuke Shumaker <>2021-04-27 21:17:46 (GMT)
committerJunio C Hamano <>2021-04-28 07:47:19 (GMT)
commit94389e7c81d47102f061b36a93e050d639fe3d40 (patch)
treeee0d60084033a1297c58fa48ed30584f8f473369 /contrib/subtree/
parentcb6551447b8e0c35408b766ad605ba357f720a0d (diff)
subtree: allow 'split' flags to be passed to 'push'
'push' does a 'split' internally, but it doesn't pass flags through to the 'split'. This is silly, if you need to pass flags to 'split', then it means that you can't use 'push'! So, have 'push' accept 'split' flags, and pass them through to 'split'. Add tests for this by copying split's tests with minimal modification. Signed-off-by: Luke Shumaker <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'contrib/subtree/')
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/subtree/ b/contrib/subtree/
index 25d69d7..431214a 100755
--- a/contrib/subtree/
+++ b/contrib/subtree/
@@ -33,13 +33,13 @@ h,help show the help
q quiet
d show debug messages
P,prefix= the name of the subdir to split out
- options for 'split'
+ options for 'split' (also: 'push')
annotate= add a prefix to commit message of new commits
b,branch= create a new branch from the split subtree
ignore-joins ignore prior --rejoin commits
onto= try connecting new tree to an existing one
rejoin merge the new branch back into HEAD
- options for 'add' and 'merge' (also: 'pull' and 'split --rejoin')
+ options for 'add' and 'merge' (also: 'pull', 'split --rejoin', and 'push --rejoin')
squash merge subtree changes as a single commit
m,message= use the given message as the commit message for the merge commit
@@ -964,7 +964,7 @@ cmd_push () {
echo "git push using: " "$repository" "$refspec"
- localrev=$(git subtree split --prefix="$arg_prefix") || die
+ localrev=$(cmd_split) || die
git push "$repository" "$localrev":"refs/heads/$refspec"
die "'$dir' must already exist. Try 'git subtree add'."