{"thread":{"id":"58663","subject":"Change in behavior of included safe.directory in system config","startedAt":"2022-10-21T05:19:43Z","lastAt":"2022-10-21T05:56:19Z","messageCount":3,"participants":["Yehuda Katz","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"465413","messageId":"CAGBAQ45f6D=XsyiOmumpAnE+OxQpuZXhMsVegrHKsxaN5mc3eQ@mail.gmail.com","threadId":"58663","inReplyTo":null,"subject":"Change in behavior of included safe.directory in system config","fromName":"Yehuda Katz","fromEmail":"yehuda@ymkatz.net","sentAt":"2022-10-21T05:19:12Z","receivedAt":"2022-10-21T05:19:43Z","isPatch":false,"sender":{"key":"yehuda@ymkatz.net","avatar":null},"body":"There seems to be some change in behavior, either to included files or\nto safe.directory between Git 2.36.0 and 2.38.0. I don't see any\nexplanation in the release notes.\nI push out a system configuration with a configuration management tool\nwhich is why it is in a separate file.\nIf I put the safe.directory configuration in the main system config,\nit works. I don't understand why this is because the value is still\nshown when running a config list.\n\nBasic config:\n[root@myhost myproject]# pwd\n/opt/myproject\n[root@myhost myproject]# cat /etc/gitconfig\n[include]\n        path = /etc/gitconfig.d/myproject\n[root@myhost myproject]# cat /etc/gitconfig.d/myproject\n[safe]\n        directory = /opt/myproject\n\nWith the old version:\n[root@myhost myproject]# git --version\ngit version 2.36.0\n[root@myhost myproject]# git config --list --show-scope\nsystem  include.path=/etc/gitconfig.d/myproject\nsystem  safe.directory=/opt/myproject\nlocal   core.repositoryformatversion=0\nlocal   core.filemode=true\nlocal   core.bare=false\nlocal   core.logallrefupdates=true\nlocal   remote.origin.url=git@gitlab.example.com:me/myproject.git\nlocal   remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*\nlocal   branch.master.remote=origin\nlocal   branch.master.merge=refs/heads/master\n[root@myhost myproject]# git pull\nAlready up to date.\n[root@myhost myproject]#\n\nAfter the upgrade:\n[root@myhost myproject]# git --version\ngit version 2.38.0\n[root@myhost myproject]# git config --list --show-scope\nsystem  include.path=/etc/gitconfig.d/puppet\nsystem  safe.directory=/opt/myproject\n[root@myhost myproject]# git pull\nfatal: detected dubious ownership in repository at '/opt/myproject'\nTo add an exception for this directory, call:\n\n        git config --global --add safe.directory /opt/myproject\n[root@myhost myproject]#\n"},{"id":"465422","messageId":"xmqqzgdpoh9l.fsf@gitster.g","threadId":"58663","inReplyTo":"CAGBAQ45f6D=XsyiOmumpAnE+OxQpuZXhMsVegrHKsxaN5mc3eQ@mail.gmail.com","subject":"Re: Change in behavior of included safe.directory in system config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-10-21T05:52:22Z","receivedAt":"2022-10-21T05:52:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yehuda Katz <yehuda@ymkatz.net> writes:\n\n> There seems to be some change in behavior, either to included files or\n> to safe.directory between Git 2.36.0 and 2.38.0. I don't see any\n> explanation in the release notes.\n>\n> I push out a system configuration with a configuration management tool\n> which is why it is in a separate file.\n> If I put the safe.directory configuration in the main system config,\n> it works. I don't understand why this is because the value is still\n> shown when running a config list.\n>\n> Basic config:\n> [root@myhost myproject]# pwd\n> /opt/myproject\n> [root@myhost myproject]# cat /etc/gitconfig\n> [include]\n>         path = /etc/gitconfig.d/myproject\n\nIs this\n\n  https://lore.kernel.org/git/pull.1360.v2.git.git.1665683027912.gitgitgadget@gmail.com/\n\nperhaps?  Can you try the version of Git from my 'next' branch?\n"},{"id":"465424","messageId":"Y1I0e4puVn0EQHbM@coredump.intra.peff.net","threadId":"58663","inReplyTo":"CAGBAQ45f6D=XsyiOmumpAnE+OxQpuZXhMsVegrHKsxaN5mc3eQ@mail.gmail.com","subject":"Re: Change in behavior of included safe.directory in system config","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2022-10-21T05:56:11Z","receivedAt":"2022-10-21T05:56:19Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Oct 21, 2022 at 01:19:12AM -0400, Yehuda Katz wrote:\n\n> There seems to be some change in behavior, either to included files or\n> to safe.directory between Git 2.36.0 and 2.38.0. I don't see any\n> explanation in the release notes.\n\nIt's a bug; see:\n\n  https://lore.kernel.org/git/pull.1360.git.git.1665603814.gitgitgadget@gmail.com/\n\nI expect the fix there will be in 2.38.2 (it didn't get into v2.38.1,\nwhich was a pre-planned security release).\n\n-Peff\n"}]}