From 111dc0eea07d4843a9ed86e4069b899224a4489b Mon Sep 17 00:00:00 2001 From: "David A. Greene" Date: Mon, 4 Feb 2013 22:06:04 -0600 Subject: [PATCH] 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 . Signed-off-by: David A. Greene Signed-off-by: Junio C Hamano --- contrib/subtree/git-subtree.sh | 6 ++++++ contrib/subtree/git-subtree.txt | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index 771f39d031..8a23f58ba0 100755 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@ -9,6 +9,7 @@ if [ $# -eq 0 ]; then fi OPTS_SPEC="\ git subtree add --prefix= +git subtree add --prefix= git subtree merge --prefix= git subtree pull --prefix= git subtree push --prefix= @@ -502,6 +503,11 @@ cmd_add() "cmd_add_commit" "$@" elif [ $# -eq 2 ]; then + # Technically we could accept a refspec here but we're + # just going to turn around and add FETCH_HEAD under the + # specified directory. Allowing a refspec might be + # misleading because we won't do anything with any other + # branches fetched via the refspec. git rev-parse -q --verify "$2^{commit}" >/dev/null || die "'$2' does not refer to a commit" diff --git a/contrib/subtree/git-subtree.txt b/contrib/subtree/git-subtree.txt index 0c44fda011..89614e5bb9 100644 --- a/contrib/subtree/git-subtree.txt +++ b/contrib/subtree/git-subtree.txt @@ -9,7 +9,8 @@ git-subtree - Merge subtrees together and split repository into subtrees SYNOPSIS -------- [verse] -'git subtree' add -P +'git subtree' add -P +'git subtree' add -P 'git subtree' pull -P 'git subtree' push -P 'git subtree' merge -P -- 2.11.4.GIT