git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] protocol.file.allow=always not honored when --local

From
Ffence.borrowing375@passmail.net <fence.borrowing375@passmail.net>
Date
Oct 21, 2025, 14:41 UTC
Message-ID
<176105772451.7.13453872556381855079.964553330@passmail.net>
In-Reply-To
<20251017071532.GA4073661@coredump.intra.peff.net>

(I apologize for resending this, the first time I forgot to CC the mailing list.)

The -c flag works for my use case, but this raises a couple questions:
- If submodules were ever to use the local config, would it be the
right thing to honor the protocol.allow and protocol.<name>.allow keys?
- Manpage GIT-SUBMODULE(1), under the add, init, and update
subcommands, notes that the local (superproject repository) config may
be updated when running these commands. In addition, the local config
is used for certain purposes, such as determining the default remote of
a new submodule. Readers know the local config is used in some way.
However, the manpage does not appear to state anywhere that, in
general, the local config is currently ignored. I found this confusing.
Is this a documentation bug?
On Fri, 2025-10-17 at 03:15 -0400, Jeff King wrote:
Show 45 quoted lines
> On Fri, Oct 17, 2025 at 02:19:38AM +0000,
> fence.borrowing375@passmail.net wrote:
> 
> > Created an empty directory, then initialized git:
> > `mkdir ~/test && cd ~/test && git init`
> > 
> > Ensured file:// transport protocol is default/unset value (file://
> > is
> > disabled by default):
> > `git config --list | grep protocol`
> > # no output
> > 
> > Enabled file:// transport for local repository:
> > `git config --local protocol.file.allow always`
> > 
> > Then, attempted to add a git submodule:
> > `git submodule add /path/to/module/.git`
> 
> I don't think this will work as you expect, because of the use of
> "git
> config --local". When we run git-clone under the hood to clone the
> new
> submodule, it is a new repository, and does not look at the config of
> the containing repository at all[1].
> 
> As you noted, setting it in the user-level "--global" config file
> would
> work. You can also override the config via the environment like:
> 
>   git -c protocol.file.allow=always submodule add ...
> 
> though note that anybody cloning will need to do the same thing (and
> of
> course have the submodule available at the exact same local path!).
> 
> -Peff
> 
> [1] There have been discussions in the past on whether submodules
> should
>     receive some config from the superproject repository. But there
> are
>     a lot of complications, as it is the right thing for some config
>     keys but not for some others. I doubt we will change the behavior
>     anytime soon.
> 
Previous: Jeff King
Message 3 of 3 in “[BUG] protocol.file.allow=always not honored when --local”
  1. fence.borrowing375@passmail.netOct 17, 2025
  2. Jeff KingOct 17, 2025
  3. fence.borrowing375@passmail.netOct 21, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.