From: Junio C Hamano Date: Sat, 13 Jun 2009 19:49:50 +0000 (-0700) Subject: Merge branch 'ph/submodule-rebase' (early part) X-Git-Tag: v1.6.4-rc0~65 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7d40f89137b456820d51ebc1cbb3ffbb966e7fec;p=git.git Merge branch 'ph/submodule-rebase' (early part) * 'ph/submodule-rebase' (early part): Rename submodule..rebase to submodule..update git-submodule: add support for --rebase. Conflicts: Documentation/git-submodule.txt git-submodule.sh --- 7d40f89137b456820d51ebc1cbb3ffbb966e7fec diff --cc Documentation/git-submodule.txt index 14256c695,f993469dc..cd8e861ce --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@@ -9,12 -9,10 +9,12 @@@ git-submodule - Initialize, update or i SYNOPSIS -------- [verse] -'git submodule' [--quiet] add [-b branch] [--] +'git submodule' [--quiet] add [-b branch] + [--reference ] [--] 'git submodule' [--quiet] status [--cached] [--] [...] 'git submodule' [--quiet] init [--] [...] - 'git submodule' [--quiet] update [--init] [-N|--no-fetch] -'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--] [...] ++'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase] + [--reference ] [--] [...] 'git submodule' [--quiet] summary [--summary-limit ] [commit] [--] [...] 'git submodule' [--quiet] foreach 'git submodule' [--quiet] sync [--] [...] @@@ -179,14 -178,15 +180,23 @@@ 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. + +--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 ab1ed02a6,f384c6b2b..19a3a840f --- a/git-submodule.sh +++ b/git-submodule.sh @@@ -15,9 -15,9 +15,10 @@@ require_work_tre command= branch= quiet= +reference= cached= nofetch= + update= # # print stuff on stdout unless -q was specified @@@ -337,15 -327,10 +343,19 @@@ cmd_update( shift nofetch=1 ;; + -r|--rebase) + shift + update="rebase" + ;; + --reference) + case "$2" in '') usage ;; esac + reference="--reference=$2" + shift 2 + ;; + --reference=*) + reference="$1" + shift + ;; --) shift break