git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] submodule: port subcommand 'set-branch' from shell to C

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
May 17, 2020, 16:11 UTC
Message-ID
<20200517161151.GA30938@danh.dev>
In-Reply-To
<20200513201737.55778-1-shouryashukla.oo@gmail.com>
On 2020-05-14 01:47:36+0530, Shourya Shukla <shouryashukla.oo@gmail.com> wrote:
Show 18 quoted lines
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 39ebdf25b5..2438ef576e 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -719,7 +719,6 @@ cmd_update()
>  # $@ = requested path
>  #
>  cmd_set_branch() {
> -	unset_branch=false
>  	branch=
>  
>  	while test $# -ne 0
> @@ -729,7 +728,7 @@ cmd_set_branch() {
>  			# we don't do anything with this but we need to accept it
>  			;;
>  		-d|--default)
> -			unset_branch=true
> +			default=1
Hi Shourya,
Thanks for your hard work,
I skimmed over the current code, it seems like this:
	default=1
is new.

If my understanding is correct, please reset its value in the beginning of this function, to avoid:

- a side effect from an assignment in get_submodule_config
  (if there's such a side effect, I'm NOT really sure).
- effect of an environment variable, c.f.
  https://lore.kernel.org/git/20200402084251.85840-1-zhiyou.jx@alibaba-inc.com/
-- 
Danh
Previous: Denton Liu
Message 14 of 14 in “submodule: port subcommand 'set-branch' from shell to C”
  1. 1/2 submodule: port subcommand 'set-branch' from shell to CShourya Shukla, May 13, 2020
  2. 2/2 submodule: Add 'quiet' option in subcommand 'set-branch'Shourya Shukla, May 13, 2020
  3. Denton LiuMay 14, 2020
  4. Shourya ShuklaMay 16, 2020
  5. Denton LiuMay 16, 2020
  6. Shourya ShuklaMay 16, 2020
  7. Denton LiuMay 16, 2020
  8. Kaartic SivaraamMay 14, 2020
  9. Junio C HamanoMay 17, 2020
  10. Kaartic SivaraamMay 17, 2020
  11. Denton LiuMay 14, 2020
  12. Shourya ShuklaMay 16, 2020
  13. Denton LiuMay 16, 2020
  14. Đoàn Trần Công DanhMay 17, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.