From: Taylor Blau <me@ttaylorr.com>
To: Sergei Golubchik <vuvova@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: bug: submodule update fails to fetch
Date: Thu, 22 Jun 2023 09:07:32 -0400 [thread overview]
Message-ID: <ZJRHlJvE4BMue1/Z@nand.local> (raw)
In-Reply-To: <ZJQr0_aC-NlLXDgj@pweza>
On Thu, Jun 22, 2023 at 01:09:07PM +0200, Sergei Golubchik wrote:
> Hi,
>
> Sometimes (my local repository has lots of branches) after switching
> branches
>
> git submodule update --init --recursive
>
> fails with something like
>
> fatal: transport 'file' not allowed
> fatal: Fetched in submodule path 'wsrep-lib', but it did not contain e238c0d240c2557229b0523a4a032f3cf8b41639. Direct fetching of that commit failed.
>
> the submodule transport is not 'file' (it's https) and the direct
> fetching of the commit actually works:
>
> cd wsrep-lib
> git fetch origin e238c0d240c2557229b0523a4a032f3cf8b41639
> git checkout e238c0d240c2557229b0523a4a032f3cf8b41639
> cd ..
>
> after that
>
> git submodule update --init --recursive
>
> succeeds. This happens deterministically, but depends on the old and new
> commits in the last checkout. As a workaround we've had to change our CI to do
It makes sense that after manually fetching the desired tip that the
submodule update goes through OK, because there is nothing to do (the
checked-out state matches what's in .gitmodules), so we don't have to
use any transport mechanism.
I recently changed the submodule update rules to disallow file-based
submodules when not directly executed by the user. See a1d4f67c12
(transport: make `protocol.file.allow` be "user" by default, 2022-07-29)
for more of the details there.
So in the short term, you should able to work around what you're seeing
by setting `protocol.file.allow` to "always" with something like
$ git config --global protocol.file.allow always
But in the short-term, I am curious why we are complaining about needing
to use the file transport when you claim that the submodule actually
needs the HTTPS transport.
Are you able to share a copy of your repository, and/or its .gitmodules
file, and your repository-local .gitconfig, as well? Do you have some
`url.<base>.insteadOf` value configured elsewhere that would be
rewriting those paths for you?
Thanks,
Taylor
next prev parent reply other threads:[~2023-06-22 13:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 11:09 bug: submodule update fails to fetch Sergei Golubchik
2023-06-22 13:07 ` Taylor Blau [this message]
2023-06-22 16:39 ` Sergei Golubchik
2023-06-23 7:26 ` Jacob Keller
2024-10-01 7:24 ` [PATCH] submodule: correct remote name with fetch Daniel Black
2024-10-01 17:27 ` Junio C Hamano
2024-10-01 17:34 ` Junio C Hamano
2024-10-08 1:49 ` Daniel Black
2024-10-08 1:49 ` [RFC PATCH v2] submodule: correct remote name with fetch Daniel Black
2024-10-08 19:23 ` Junio C Hamano
2024-10-09 3:32 ` [PATCH v3] " Daniel Black
2024-10-09 17:51 ` Junio C Hamano
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=ZJRHlJvE4BMue1/Z@nand.local \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=vuvova@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).