aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/subtree/git-subtree.sh
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@datawire.io>2021-04-27 15:17:46 -0600
committerJunio C Hamano <gitster@pobox.com>2021-04-28 16:47:19 +0900
commit94389e7c81d47102f061b36a93e050d639fe3d40 (patch)
treeee0d60084033a1297c58fa48ed30584f8f473369 /contrib/subtree/git-subtree.sh
parentsubtree: allow --squash to be used with --rejoin (diff)
downloadgit-94389e7c81d47102f061b36a93e050d639fe3d40.tar.gz
git-94389e7c81d47102f061b36a93e050d639fe3d40.zip
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 <lukeshu@datawire.io> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/subtree/git-subtree.sh')
-rwxr-xr-xcontrib/subtree/git-subtree.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 25d69d7973..431214a1d3 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -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 () {
repository=$1
refspec=$2
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"
else
die "'$dir' must already exist. Try 'git subtree add'."