contrib/subtree: fix synopsis
authorDavid A. Greene <greened@obbligato.org>
Tue, 5 Feb 2013 04:06:04 +0000 (22:06 -0600)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Feb 2013 23:23:05 +0000 (15:23 -0800)
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>
contrib/subtree/git-subtree.sh
contrib/subtree/git-subtree.txt
index 771f39d0310135f15e8ab3ed252c6a6ffcd5c8a9..8a23f58ba04c4b1402c66d03db69d0c109c90b58 100755 (executable)
@@ -9,6 +9,7 @@ if [ $# -eq 0 ]; then
 fi
 OPTS_SPEC="\
 git subtree add   --prefix=<prefix> <commit>
+git subtree add   --prefix=<prefix> <repository> <commit>
 git subtree merge --prefix=<prefix> <commit>
 git subtree pull  --prefix=<prefix> <repository> <refspec...>
 git subtree push  --prefix=<prefix> <repository> <refspec...>
@@ -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"
 
index 0c44fda011bcfd39fd8c464c35017df620a91ff9..89614e5bb98cc1122032aabdd2dc54beeda1cba8 100644 (file)
@@ -9,7 +9,8 @@ git-subtree - Merge subtrees together and split repository into subtrees
 SYNOPSIS
 --------
 [verse]
-'git subtree' add   -P <prefix> <commit>
+'git subtree' add   -P <prefix> <refspec>
+'git subtree' add   -P <prefix> <repository> <refspec>
 'git subtree' pull  -P <prefix> <repository> <refspec...>
 'git subtree' push  -P <prefix> <repository> <refspec...>
 'git subtree' merge -P <prefix> <commit>