From: Danh Doan Date: Tue, 29 Oct 2019 09:15:38 GMT Subject: Re: [PATCH v2] submodule: teach set-url subcommand Message-ID: <20191029091538.GB17223@danh.dev> In-Reply-To: On 2019-10-29 01:34:19 -0700, Denton Liu wrote: > diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt > index 1f46380af2..f1c4689f24 100644 > --- a/Documentation/git-submodule.txt > +++ b/Documentation/git-submodule.txt > @@ -16,6 +16,7 @@ SYNOPSIS > 'git submodule' [--quiet] deinit [-f|--force] (--all|[--] ...) > 'git submodule' [--quiet] update [] [--] [...] > 'git submodule' [--quiet] set-branch [] [--] > +'git submodule' [--quiet] set-url [] [--] I skimmed over this patch and found no options. [] should be removed > @@ -180,6 +181,11 @@ set-branch (-d|--default) [--] :: > `--default` option removes the submodule..branch configuration > key, which causes the tracking branch to default to 'master'. > > +set-url [--] :: > + Sets the URL of the specified submodule to . Then, it will > + automatically synchronize the submodule's new remote URL > + configuration. > + > summary [--cached|--files] [(-n|--summary-limit) ] [commit] [--] [...]:: > Show commit summary between the given commit (defaults to HEAD) and > working tree/index. For a submodule in question, a series of commits > diff --git a/git-submodule.sh b/git-submodule.sh > index c7f58c5756..f7374ddbd6 100755 > --- a/git-submodule.sh > +++ b/git-submodule.sh > @@ -12,6 +12,7 @@ USAGE="[--quiet] [--cached] > or: $dashless [--quiet] deinit [-f|--force] (--all| [--] ...) > or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference ] [--recursive] [--] [...] > or: $dashless [--quiet] set-branch (--default|--branch ) [--] > + or: $dashless [--quiet] set-url [--] > or: $dashless [--quiet] summary [--cached|--files] [--summary-limit ] [commit] [--] [...] > or: $dashless [--quiet] foreach [--recursive] > or: $dashless [--quiet] sync [--recursive] [--] [...] > diff --git a/t/t7420-submodule-set-url.sh b/t/t7420-submodule-set-url.sh > new file mode 100755 > index 0000000000..9bc941ced3 > --- /dev/null > +++ b/t/t7420-submodule-set-url.sh > + grep "url = \.\./newsubmodule" .gitmodules && grep -F "url = ../newsubmodule" will be easier to read. -- Danh