Skip to content

Commit 111dc0e

Browse files
greenedgitster
authored andcommitted
contrib/subtree: fix synopsis
Fix the documentation of add to show that a repository can be specified along with a commit. Suggested by Yann Dirson <dirson@bertin.fr>. Signed-off-by: David A. Greene <greened@obbligato.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 10a4958 commit 111dc0e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if [ $# -eq 0 ]; then
99
fi
1010
OPTS_SPEC="\
1111
git subtree add --prefix=<prefix> <commit>
12+
git subtree add --prefix=<prefix> <repository> <commit>
1213
git subtree merge --prefix=<prefix> <commit>
1314
git subtree pull --prefix=<prefix> <repository> <refspec...>
1415
git subtree push --prefix=<prefix> <repository> <refspec...>
@@ -502,6 +503,11 @@ cmd_add()
502503

503504
"cmd_add_commit" "$@"
504505
elif [ $# -eq 2 ]; then
506+
# Technically we could accept a refspec here but we're
507+
# just going to turn around and add FETCH_HEAD under the
508+
# specified directory. Allowing a refspec might be
509+
# misleading because we won't do anything with any other
510+
# branches fetched via the refspec.
505511
git rev-parse -q --verify "$2^{commit}" >/dev/null ||
506512
die "'$2' does not refer to a commit"
507513

contrib/subtree/git-subtree.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ git-subtree - Merge subtrees together and split repository into subtrees
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git subtree' add -P <prefix> <commit>
12+
'git subtree' add -P <prefix> <refspec>
13+
'git subtree' add -P <prefix> <repository> <refspec>
1314
'git subtree' pull -P <prefix> <repository> <refspec...>
1415
'git subtree' push -P <prefix> <repository> <refspec...>
1516
'git subtree' merge -P <prefix> <commit>

0 commit comments

Comments
 (0)