git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: Shourya Shukla <shouryashukla.oo@gmail.com>
Cc: git@vger.kernel.org, christian.couder@gmail.com,
	kaartic.sivaraam@gmail.com, gitster@pobox.com,
	liu.denton@gmail.com, Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH 1/2] submodule: port subcommand 'set-branch' from shell to C
Date: Sun, 17 May 2020 23:11:51 +0700	[thread overview]
Message-ID: <20200517161151.GA30938@danh.dev> (raw)
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:
> 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

      parent reply	other threads:[~2020-05-17 16:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 20:17 [PATCH 1/2] submodule: port subcommand 'set-branch' from shell to C Shourya Shukla
2020-05-13 20:17 ` [PATCH 2/2] submodule: Add 'quiet' option in subcommand 'set-branch' Shourya Shukla
2020-05-14 10:15   ` Denton Liu
2020-05-16  5:50     ` Shourya Shukla
2020-05-16  8:56       ` Denton Liu
2020-05-16 10:40         ` Shourya Shukla
2020-05-16 11:06           ` Denton Liu
2020-05-14  9:07 ` [PATCH 1/2] submodule: port subcommand 'set-branch' from shell to C Kaartic Sivaraam
2020-05-17 15:06   ` Junio C Hamano
2020-05-17 15:21     ` Kaartic Sivaraam
2020-05-14 10:10 ` Denton Liu
2020-05-16 10:37   ` Shourya Shukla
2020-05-16 10:55     ` Denton Liu
2020-05-17 16:11 ` Đoàn Trần Công Danh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200517161151.GA30938@danh.dev \
    --to=congdanhqx@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kaartic.sivaraam@gmail.com \
    --cc=liu.denton@gmail.com \
    --cc=shouryashukla.oo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).