git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathon Reinhart <jonathon.reinhart@gmail.com>
To: jrnieder@gmail.com
Cc: git@vger.kernel.org, sbeller@google.com
Subject: Re: 'git submodule update' ignores [http] config
Date: Fri, 10 Aug 2018 13:02:47 -0400	[thread overview]
Message-ID: <CAPFHKze39tDyVVMg=op9RKty7OgWnscww7JvXAByNU7JxJJfLQ@mail.gmail.com> (raw)
In-Reply-To: <20180810030624.GA101965@aiede.svl.corp.google.com>

Thanks Jonathan.

The confirmation that the super-project config does not apply to the
submodules is what I was really looking for. We'll go from here.

This is a bit complicated, because this config is all generated
dynamically by the GitLab CI Runner when it is setting up a build job.
(See the linked issue in my first email for the gory details).

Thank you,
Jonathon
>
> +cc: Stefan, who has been looking at fetch --recurse-submodules recently
> Hi,
>
> Jonathon Reinhart wrote:
>
> > I've narrowed it down to an observation that the [http] config seems
> > to be ignored by 'git submodule update'. Shouldn't those options be
> > respected by submodules?
> >
> > Given a .git/config file like this:
> >
> > ------------------------------------------------------------------------
> > [fetch]
> >     recurseSubmodules = false
> > [http "https://gitlab.exmaple.com"]
> >     sslCAInfo = C:\\Users\\gitlab-runner\\builds\\deadbeef\\0\\somegroup\\someproj.git\\CA_SERVER_TLS_CA_FILE
> [...]
> > C:\Users\jreinhart\testrepo>set GIT_CURL_VERBOSE=1
> > C:\Users\jreinhart\testrepo>git fetch
> [...]
> > *   CAfile: C:\Users\gitlab-runner\builds\deadbeef\0\somegroup\someproj.git\CA_SERVER_TLS_CA_FILE
> [...]
> > C:\Users\jreinhart\testrepo>git checkout master
> > C:\Users\jreinhart\testrepo>git submodule update --init
> [...]
> > *   CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
> [...]
> > Note that the CAfile reverted to its default instead of using the same
> > one from the `git fetch`.
>
> Interesting.
>
> The context is that "git submodule update" is simply running commands
> like "git fetch" inside the submodules, and the repository-local
> config of the superproject does not apply there.
>
> In the long run, commands like "git fetch --recurse-submodules" may
> chaange to use a single process.  It's possible that some of the
> repository-local configuration of the superproject would apply at that
> point, though the inconsistency would be confusing, so probably not
> these particular settings.  Anyway, that's a faraway future; today,
> "git fetch --recurse-submodules" is also running "git fetch" commands
> inside the submodules, and the repository-local config of the
> superproject does not apply there.
>
> Would it work for you to put this configuration in the global config
> file ("git config --global --edit")?  That way, it would be used by
> all repositories.  If you want it only to apply within the testrepo
> directory, you can use conditional includes --- something like:
>
>   in $HOME/.git/config/testrepo-ca:
>
>   [http "https://gitlab.example.com"]
>         sslCAInfo = ...
>
>   in $HOME/.git/config/git:
>
>   [includeIf "gitdir/i:~/testrepo/**"]
>         path = testrepo-ca
>
> Thanks and hope that helps,
> Jonathan

      reply	other threads:[~2018-08-10 17:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09 22:50 'git submodule update' ignores [http] config Jonathon Reinhart
2018-08-10  3:06 ` Jonathan Nieder
2018-08-10 17:02   ` Jonathon Reinhart [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

  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='CAPFHKze39tDyVVMg=op9RKty7OgWnscww7JvXAByNU7JxJJfLQ@mail.gmail.com' \
    --to=jonathon.reinhart@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=sbeller@google.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).