Subject: Re: [PATCH v2] submodule: teach set-url subcommand

From: Danh Doan <[email-masked]>
Date: Tue, 29 Oct 2019 16:15:38 +0700

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|[--] <path>...)
>  'git submodule' [--quiet] update [<options>] [--] [<path>...]
>  'git submodule' [--quiet] set-branch [<options>] [--] <path>
> +'git submodule' [--quiet] set-url [<options>] [--] <path> <newurl>

I skimmed over this patch and found no options.
[<options>] should be removed

> @@ -180,6 +181,11 @@ set-branch (-d|--default) [--] <path>::
>  	`--default` option removes the submodule.<name>.branch configuration
>  	key, which causes the tracking branch to default to 'master'.
>  
> +set-url [--] <path> <newurl>::
> +	Sets the URL of the specified submodule to <newurl>. Then, it will
> +	automatically synchronize the submodule's new remote URL
> +	configuration.
> +
>  summary [--cached|--files] [(-n|--summary-limit) <n>] [commit] [--] [<path>...]::
>  	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| [--] <path>...)
>     or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]
>     or: $dashless [--quiet] set-branch (--default|--branch <branch>) [--] <path>
> +   or: $dashless [--quiet] set-url [--] <path> <newurl>
>     or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
>     or: $dashless [--quiet] foreach [--recursive] <command>
>     or: $dashless [--quiet] sync [--recursive] [--] [<path>...]
> 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