From: Junio C Hamano Date: Sun, 21 Jun 2009 04:51:13 +0000 (-0700) Subject: Merge branch 'ph/submodule-rebase' X-Git-Tag: v1.6.4-rc0~44 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a49eb197d809d2d7efbd81d935c61e1a0caa983e;p=git.git Merge branch 'ph/submodule-rebase' * ph/submodule-rebase: git-submodule: add support for --merge. Conflicts: Documentation/git-submodule.txt git-submodule.sh --- a49eb197d809d2d7efbd81d935c61e1a0caa983e diff --cc Documentation/git-submodule.txt index cd8e861ce,2289d11f0..470bd75ad --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@@ -180,23 -179,25 +181,33 @@@ OPTION This option is only valid for the update command. Don't fetch new objects from the remote site. ---rebase:: - This option is only valid for the update command. - Rebase the current branch onto the commit recorded in the - superproject. If this option is given, the submodule's HEAD will not - be detached. If a a merge failure prevents this process, you will have - to resolve these failures with linkgit:git-rebase[1]. - If the key `submodule.$name.update` is set to `rebase`, this option is - implicit. - + --merge:: + This option is only valid for the update command. + Merge the commit recorded in the superproject into the current branch + of the submodule. If this option is given, the submodule's HEAD will + not be detached. If a merge failure prevents this process, you will + have to resolve the resulting conflicts within the submodule with the + usual conflict resolution tools. + If the key `submodule.$name.update` is set to `merge`, this option is + implicit. + +--rebase:: + This option is only valid for the update command. + Rebase the current branch onto the commit recorded in the + superproject. If this option is given, the submodule's HEAD will not + be detached. If a a merge failure prevents this process, you will have + to resolve these failures with linkgit:git-rebase[1]. + If the key `submodule.$name.update` is set to `rebase`, this option is + implicit. + +--reference :: + This option is only valid for add and update commands. These + commands sometimes need to clone a remote repository. In this case, + this option will be passed to the linkgit:git-clone[1] command. ++ +*NOTE*: Do *not* use this option unless you have read the note +for linkgit:git-clone[1]'s --reference and --shared options carefully. + ...:: Paths to submodule(s). When specified this will restrict the command to only operate on the submodules found at the specified paths. diff --cc git-submodule.sh index 19a3a840f,3aff37970..f4f356267 --- a/git-submodule.sh +++ b/git-submodule.sh @@@ -347,15 -331,10 +347,19 @@@ cmd_update( shift update="rebase" ;; + --reference) + case "$2" in '') usage ;; esac + reference="--reference=$2" + shift 2 + ;; + --reference=*) + reference="$1" + shift + ;; + -m|--merge) + shift + update="merge" + ;; --) shift break