git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Alex Levy <alex.levy@voltserver.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: possible submodule bug?
Date: Sat, 1 Jun 2019 01:12:07 +0000	[thread overview]
Message-ID: <20190601011206.GO8616@genre.crustytoothpaste.net> (raw)
In-Reply-To: <BN8PR11MB35711F87B0981C6897DCE3CC89180@BN8PR11MB3571.namprd11.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 1661 bytes --]

On 2019-05-30 at 18:16:17, Alex Levy wrote:
> I've found a workaround if I manually edit .git/config in each clone to reflect the correct URL.  After doing that, running "git submodule update --init" works as expected.
> 
> My understanding is that I shouldn't ever have to edit anything in the .git directory.  So, have I found a bug with .gitmodules being ignored after adding a given submodule?  Or is this just user error, a case of "Don't do that.  Initialize the submodule with the correct URL and move on."?

git-submodule(1) documents this behavior under the init subcommand:

  When present, it will also copy the value of `submodule.$name.update`.
  This command does not alter existing information in .git/config. You
  can then customize the submodule clone URLs in .git/config for your
  local setup and proceed to `git submodule update`; you can also just
  use `git submodule update --init` without the explicit 'init' step if
  you do not intend to customize any submodule locations.

The goal is to let you customize the URL. For example, maybe you are
using an open-source project with submodules but you're on a restricted
corporate network where access to certain sites is prohibited, or maybe
the server hosting the submodule is down temporarily or permanently.

So this isn't really a bug, but more of a feature, even if it's
inconvenient in this particular case.

You can, however, use "git submodule sync" to sync across updated
changes to the URL. This is a bunch easier and faster than editing
things by hand or with "git config".
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

      reply	other threads:[~2019-06-01  1:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 18:16 possible submodule bug? Alex Levy
2019-06-01  1:12 ` brian m. carlson [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=20190601011206.GO8616@genre.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=alex.levy@voltserver.com \
    --cc=git@vger.kernel.org \
    /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).