From: Glen Choo <chooglen@google.com>
To: "Mantas Mikulėnas" <grawity@gmail.com>, git@vger.kernel.org
Cc: Derrick Stolee <derrickstolee@github.com>,
Taylor Blau <me@ttaylorr.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: 2.38 "protected configuration" ignores includes
Date: Wed, 12 Oct 2022 10:09:05 -0700 [thread overview]
Message-ID: <kl6lbkqh0y1a.fsf@chooglen-macbookpro.roam.corp.google.com> (raw)
In-Reply-To: <CAPWNY8W_Tr-WoD-GXBddD5Y8w5Y4w+gDNYQdOAJ1uBwVHuRrsQ@mail.gmail.com>
Mantas Mikulėnas <grawity@gmail.com> writes:
> After Git 2.38 (specifically after commit 6061601d9), git no longer
> honors safe.directory settings in files that are [include]'d from the
> main global configuration file, even though they are shown as being in
> global scope by `git config --show-scope --show-origin`.
>
> The docs added by
> https://github.com/git/git/commit/779ea9303a7de3d618f3b0e329ebb89529ab3285
> only talk about scopes and do not mention anything about [include]
> being specifically ignored.
>
> $ git config --get-all --show-scope --show-origin safe.directory
> global file:/home/grawity/.config/git/config /srv/this.works
> global file:/home/grawity/.config/git/config.local /srv/this.does.not.work
>
> # ~/.config/git/config (owned by grawity:users)
> [safe]
> directory = /srv/this.works
> [include]
> path = ~/.config/git/config.local
>
> # ~/.config/git/config.local (also owned by grawity:users)
> [safe]
> directory = /srv/this.does.not.work
>
> --
> Mantas Mikulėnas
CC-ed some folks who have interest in safe.directory and/or have looked
at the safe.bareRepository series.
Thanks for the report. As the author of the series in question, this
wasn't an intended change.
Protect config, as implemented in 5b3c650777 (config: learn
`git_protected_config()`, 2022-07-14), reads from a hardcoded set of
file paths without considering "include"s, so this bug is not surprising
in retrospect.
I believe this can be fixed by replacing this implementation with an
invocation to config_with_options() (which knows about "include"s)
should be adequate to fix this.
I'll prioritize a test and a fix for this.
prev parent reply other threads:[~2022-10-12 17:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 6:16 2.38 "protected configuration" ignores includes Mantas Mikulėnas
2022-10-12 17:09 ` Glen Choo [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=kl6lbkqh0y1a.fsf@chooglen-macbookpro.roam.corp.google.com \
--to=chooglen@google.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=grawity@gmail.com \
--cc=me@ttaylorr.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).