git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	Johannes Sixt <j6t@kdbg.org>, Jeff King <peff@peff.net>
Subject: Re: [PATCH] submodule: Port resolve_relative_url from shell to C
Date: Thu, 14 Jan 2016 15:43:27 -0800	[thread overview]
Message-ID: <CAGZ79kZZxoD=+GJVPOCuQK_oLqR-pOQw2QM98Yxx3XoGRMAXfQ@mail.gmail.com> (raw)
In-Reply-To: <56980A14.1060605@web.de>

On Thu, Jan 14, 2016 at 12:50 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
> Am 13.01.2016 um 23:47 schrieb Stefan Beller:
>>
>> On Wed, Jan 13, 2016 at 2:03 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>>
>>> Stefan Beller <sbeller@google.com> writes:
>>>
>>>> Later on we want to deprecate the `git submodule init` command and make
>>>> it implicit in other submodule commands.
>>>
>>>
>>> I doubt there is a concensus for "deprecate" part to warrant the use
>>> of "we want" here.  I tend to think that the latter half of the
>>> sentence is uncontroversial, i.e. it is a good idea to make other
>>> "submodule" subcommands internally call it when it makes sense, and
>>> also make knobs available to other commands like "clone" and
>>> possibly "checkout" so that the users do not have to do the
>>> "submodule init" as a separate step, though.
>>
>>
>> Maybe I need to rethink my strategy here and deliver a patch series
>> which includes a complete port of `submodule init`, and maybe even
>> options in checkout (and clone) to run `submodule init`. That way the
>> immediate benefit would be clear on why the series is a good idea.
>
>
> I think that makes lots of sense. It looks to me like clone already
> has that option (as --recurse-submodules must init the submodules),
> but it might make sense to add such an option to checkout to init
> (and then also update) all newly appearing submodules (just like
> "git submodule update" has the --init option for the same purpose).

The next series I'll send out will replace the shell part of `git
submodule init`
with a small wrapper for `git submodule--helper init` which will then have
the functionality to initialize submodules. I'll break that C code in a way
that we'll end up having a function like:

    void init_submodule(const char *path);

After that is donw, I'll try to call this from all the places which currently
do setup a child process for init or `update --init`.

>
>> The current wording is mostly arguing to Jens, how to do the submodule
>> groups thing later on, but skipping the immediate steps.
>
>
> I really believe that in the future a lot of users will hop on to the
> automatically-init-and-update-submodules train once we have it (and I
> think users of the groups feature want to be on that train by default).

Rereading old mail I wonder if we had a miss understanding on the groups
feature or rather the  automatically-init-submodules feature.

As far as I understand initializing git submodules, you can do it multiple times
without hurting yourself, i.e. an implementation of update could look like

update()
{
    auto-init-subs = { }
    if groups selected:
        auto-init-subs = {subs selected by groups}
    foreach uninitialized submodule:
        if submodule has set auto-init (in superprojects .gitmodule I'd guess)
            auto-init-subs += {that submodule}
    if auto-init-subs not empty:
        git submodule init <auto-init-subs>
    update-as-we-know-it
}

and then multiple calls to update() would not hurt.
That way we would not need to add any logic to the init sub command as my
first patch series had. There it was more like:

update()
{
    if groups selected:
        git submodule init --groups # have the logic inside of init
    update-as-we-know-it
}

I think I'll redo the groups patch series as the former now.

>
> But I also believe we'll have to support the old school init-manually
> and update-when-I-want-to use cases for a very long time, as lots of
> work flows are built around that.

Sure, the "submodule init" command is not going away. I just want to have
an easy way to access it from within C code, hence the rewrite effort.

Thanks,
Stefan

  reply	other threads:[~2016-01-14 23:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 18:15 [PATCH] submodule: Port resolve_relative_url from shell to C Stefan Beller
2016-01-13 22:03 ` Junio C Hamano
2016-01-13 22:47   ` Stefan Beller
2016-01-14 20:50     ` Jens Lehmann
2016-01-14 23:43       ` Stefan Beller [this message]
2016-01-15 17:37     ` Junio C Hamano
2016-01-15 22:58       ` Stefan Beller
2016-01-15 23:03         ` Junio C Hamano
2016-01-14 20:57   ` Johannes Sixt
2016-01-14 22:49     ` Stefan Beller
2016-01-13 22:03 ` Eric Sunshine
2016-01-13 23:37   ` Stefan Beller
  -- strict thread matches above, loose matches on Subject: below --
2015-12-10  1:07 Stefan Beller
2015-12-10  6:48 ` Johannes Sixt
2015-12-16 22:36   ` Stefan Beller

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='CAGZ79kZZxoD=+GJVPOCuQK_oLqR-pOQw2QM98Yxx3XoGRMAXfQ@mail.gmail.com' \
    --to=sbeller@google.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=peff@peff.net \
    /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).