git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Glen Choo <chooglen@google.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Emily Shaffer <emilyshaffer@google.com>
Subject: Re: [PATCH 5/8] submodule API & "absorbgitdirs": remove "----recursive" option
Date: Fri, 04 Nov 2022 10:08:07 -0700	[thread overview]
Message-ID: <kl6l5yfuy7ew.fsf@chooglen-macbookpro.roam.corp.google.com> (raw)
In-Reply-To: <221104.86fsezze6p.gmgdl@evledraar.gmail.com>

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Thu, Nov 03 2022, Glen Choo wrote:
>
>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>>
>>> Remove the "----recursive" option to "git submodule--helper
>>> absorbgitdirs" (yes, with 4 dashes, not 2).
>>
>> o.O
>>
>> At least this makes it pretty easy to grep for usage, and it makes sense
>> that we've never used it (otherwise this would've been caught).
>>
>>> diff --git a/submodule.c b/submodule.c
>>> index fe1e3f03905..8fa2ad457b2 100644
>>> --- a/submodule.c
>>> +++ b/submodule.c
>>> @@ -2332,8 +2331,7 @@ static void absorb_git_dir_into_superproject_recurse(const char *path)
>>>   * having its git directory within the working tree to the git dir nested
>>>   * in its superprojects git dir under modules/.
>>>   */
>>> -void absorb_git_dir_into_superproject(const char *path,
>>> -				      unsigned flags)
>>> +void absorb_git_dir_into_superproject(const char *path)
>>>  {
>>>  	int err_code;
>>>  	const char *sub_git_dir;
>>> @@ -2382,12 +2380,7 @@ void absorb_git_dir_into_superproject(const char *path,
>>>  	}
>>>  	strbuf_release(&gitdir);
>>>  
>>> -	if (flags & ABSORB_GITDIR_RECURSE_SUBMODULES) {
>>> -		if (flags & ~ABSORB_GITDIR_RECURSE_SUBMODULES)
>>> -			BUG("we don't know how to pass the flags down?");
>>> -
>>> -		absorb_git_dir_into_superproject_recurse(path);
>>> -	}
>>> +	absorb_git_dir_into_superproject_recurse(path);
>>>  }
>>
>> Maybe I'm misreading, but I don't follow this change.
>>
>> Before, we recursed into the submodule only if the
>> ABSORB_GITDIR_RECURSE_SUBMODULES flag is set (which we now know is
>> never), but now we unconditionally recurse into the submodule.
>
> No, it's always set. I.e. ----recursive did nothing, but the default was
> to always set ABSORB_GITDIR_RECURSE_SUBMODULES, so it was never not-set
> (and there was no --no---recursive user).
>
> So we should be unconditionally going on this recursive path.

Ah, because we initialize flags to ABSORB_GITDIR_RECURSE_SUBMODULES. I
see that this is also covered by t/t7412-submodule-absorbgitdirs.sh,
which has a few nested submodules tests. Thanks!

Since it's clear that recursing should be unconditional, I think we
don't need the previous patch, but I'm fine either way.

  parent reply	other threads:[~2022-11-04 17:08 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02  7:53 [PATCH 0/8] submodule: tests, cleanup to prepare for built-in Ævar Arnfjörð Bjarmason
2022-11-02  7:53 ` [PATCH 1/8] submodule--helper: move "config" to a test-tool Ævar Arnfjörð Bjarmason
2022-11-03 22:09   ` Glen Choo
2022-11-02  7:53 ` [PATCH 2/8] submodule tests: add tests for top-level flag output Ævar Arnfjörð Bjarmason
2022-11-03 22:30   ` Glen Choo
2022-11-02  7:54 ` [PATCH 3/8] submodule tests: test for a "foreach" blind-spot Ævar Arnfjörð Bjarmason
2022-11-02  7:54 ` [PATCH 4/8] submodule.c: refactor recursive block out of absorb function Ævar Arnfjörð Bjarmason
2022-11-02  7:54 ` [PATCH 5/8] submodule API & "absorbgitdirs": remove "----recursive" option Ævar Arnfjörð Bjarmason
2022-11-03 22:53   ` Glen Choo
2022-11-04  1:42     ` Ævar Arnfjörð Bjarmason
2022-11-04 13:07       ` FW: " Simpson, Phyllis
2022-11-04 17:08       ` Glen Choo [this message]
2022-11-02  7:54 ` [PATCH 6/8] submodule--helper: remove --prefix from "absorbgitdirs" Ævar Arnfjörð Bjarmason
2022-11-02  7:54 ` [PATCH 7/8] submodule--helper: drop "update --prefix <pfx>" for "-C <pfx> update" Ævar Arnfjörð Bjarmason
2022-11-02  7:54 ` [PATCH 8/8] submodule--helper: use OPT_SUBCOMMAND() API Ævar Arnfjörð Bjarmason
2022-11-03 23:31   ` Glen Choo
2022-11-04  1:22     ` Ævar Arnfjörð Bjarmason
2022-11-04 17:02       ` Glen Choo
2022-11-05 14:23         ` Ævar Arnfjörð Bjarmason
2022-11-07 17:16           ` Glen Choo
2022-11-04 17:10 ` [PATCH 0/8] submodule: tests, cleanup to prepare for built-in Glen Choo
2022-11-04 19:07   ` Taylor Blau
2022-11-08 14:10 ` [PATCH v2 0/9] " Ævar Arnfjörð Bjarmason
2022-11-08 14:10   ` [PATCH v2 1/9] submodule--helper: move "config" to a test-tool Ævar Arnfjörð Bjarmason
2022-11-08 14:10   ` [PATCH v2 2/9] submodule tests: add tests for top-level flag output Ævar Arnfjörð Bjarmason
2022-11-08 14:10   ` [PATCH v2 3/9] submodule--helper: fix a memory leak in "status" Ævar Arnfjörð Bjarmason
2022-11-08 14:10   ` [PATCH v2 4/9] submodule tests: test for a "foreach" blind-spot Ævar Arnfjörð Bjarmason
2022-11-08 14:10   ` [PATCH v2 5/9] submodule.c: refactor recursive block out of absorb function Ævar Arnfjörð Bjarmason
2022-11-08 14:10   ` [PATCH v2 6/9] submodule API & "absorbgitdirs": remove "----recursive" option Ævar Arnfjörð Bjarmason
2022-11-08 14:10   ` [PATCH v2 7/9] submodule--helper: remove --prefix from "absorbgitdirs" Ævar Arnfjörð Bjarmason
2022-11-08 14:10   ` [PATCH v2 8/9] submodule--helper: drop "update --prefix <pfx>" for "-C <pfx> update" Ævar Arnfjörð Bjarmason
2022-11-08 14:10   ` [PATCH v2 9/9] submodule--helper: use OPT_SUBCOMMAND() API Ævar Arnfjörð Bjarmason
2022-11-08 18:30   ` [PATCH v2 0/9] submodule: tests, cleanup to prepare for built-in Glen Choo
2022-11-08 18:34     ` Ævar Arnfjörð Bjarmason
2022-11-08 19:20       ` Glen Choo

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=kl6l5yfuy7ew.fsf@chooglen-macbookpro.roam.corp.google.com \
    --to=chooglen@google.com \
    --cc=avarab@gmail.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).