{"thread":{"id":"62870","subject":"[BUG] PREFIX environment variable ignored by git config --system","startedAt":"2025-01-29T16:34:38Z","lastAt":"2025-01-30T21:57:44Z","messageCount":15,"participants":["rsbecker@nexbridge.com","Junio C Hamano","Ben Knoble"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"511418","messageId":"007f01db726b$ac911ce0$05b356a0$@nexbridge.com","threadId":"62870","inReplyTo":null,"subject":"[BUG] PREFIX environment variable ignored by git config --system","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-01-29T16:34:26Z","receivedAt":"2025-01-29T16:34:38Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"Thank you for filling out a Git bug report!\n\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\nexport PREFIX=/home/randall\ngit config --system --list\n\nWhat did you expect to happen? (Expected behavior)\nGit should use ${PREFIX}/etc/gitconfig instead of the build location to\nlocate\nSystem configuration items, per 10.8 in the git-scm website documentation\non Environment Variables.\nGit should have reported:\nfatal: unable to read config file '/home/randall/etc/gitconfig': No such\nfile or directory\n\nWhat happened instead? (Actual behavior)\ngit used /usr/local-ssl3.0/etc/gitconfig instead and reported that the file\ndoes not exist:\nfatal: unable to read config file '/usr/local-ssl3.0/etc/gitconfig': No such\nfile or directory\n\nWhat's different between what you expected and what actually happened?\nThe directory being used based on the PREFIX variable.\n\nAnything else you want to add:\nThis appears to be a problem on all platforms.\n\n[System Info]\ngit version:\ngit version 2.47.1\ncpu: NSV\nbuilt from commit: 92999a42db1c5f43f330e4f2bca4026b5b81576f\nsizeof-long: 4\n\n[System Info]\ngit version:\ngit version 2.45.1\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\n\n--\nBrief whoami: NonStop&UNIX developer since approximately\nUNIX(421664400)\nNonStop(211288444200000000)\n-- In real life, I talk too much.\n\n\n\n"},{"id":"511419","messageId":"xmqqbjvpk1wo.fsf@gitster.g","threadId":"62870","inReplyTo":"007f01db726b$ac911ce0$05b356a0$@nexbridge.com","subject":"Re: [BUG] PREFIX environment variable ignored by git config --system","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-29T16:41:59Z","receivedAt":"2025-01-29T16:42:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<rsbecker@nexbridge.com> writes:\n\n> Thank you for filling out a Git bug report!\n>\n> Please answer the following questions to help us understand your issue.\n>\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> export PREFIX=/home/randall\n> git config --system --list\n>\n> What did you expect to happen? (Expected behavior)\n> Git should use ${PREFIX}/etc/gitconfig instead of the build location to\n\nBut that is now how PREFIX works, as far as I remember.  PREFIX is a\nbuild-time thing.\n\nPerhaps you are looking for RUNTIME_PREFIX build-time option?  I do\nnot know how well it is maintained these days, and if it allows you\nto futz with the paths at runtime (without _moving_ the executable\nand all other installation material en masse), though.\n"},{"id":"511422","messageId":"008201db726f$6e6990b0$4b3cb210$@nexbridge.com","threadId":"62870","inReplyTo":"xmqqbjvpk1wo.fsf@gitster.g","subject":"RE: [BUG] PREFIX environment variable ignored by git config --system","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-01-29T17:01:19Z","receivedAt":"2025-01-29T17:01:28Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 29, 2025 11:42 AM, Junio C Hamano. Wrote:\n><rsbecker@nexbridge.com> writes:\n>\n>> Thank you for filling out a Git bug report!\n>>\n>> Please answer the following questions to help us understand your issue.\n>>\n>> What did you do before the bug happened? (Steps to reproduce your\n>> issue) export PREFIX=/home/randall git config --system --list\n>>\n>> What did you expect to happen? (Expected behavior) Git should use\n>> ${PREFIX}/etc/gitconfig instead of the build location to\n>\n>But that is now how PREFIX works, as far as I remember.  PREFIX is a\nbuild-time\n>thing.\n>\n>Perhaps you are looking for RUNTIME_PREFIX build-time option?  I do not\nknow\n>how well it is maintained these days, and if it allows you to futz with the\npaths at\n>runtime (without _moving_ the executable and all other installation\nmaterial en\n>masse), though.\n\nThe documentation on the Environment Configuration page seems to imply that\nthese are run-time variables, not build time, which should come from the\nconfig.mak.uname. In any event, I'm in a situation where I do not have the\nsecurity to create the actual ../etc directory so am trying to test an\nalternate\nlocation. Some of the customers I am supporting have experienced this also.\n\nAny ideas on handling an execution time override of the system location,\ninstead of\njust using GIT_CONFIG_NOSYSTEM to turn off --system?\n\nI would gladly add GIT_CONFIG_SYSTEM=path with a little guidance, if that's\nwhat it\ncomes down to.\n\n--Randall\n\n"},{"id":"511425","messageId":"008501db727a$80b08430$82118c90$@nexbridge.com","threadId":"62870","inReplyTo":"xmqqbjvpk1wo.fsf@gitster.g","subject":"RE: [BUG] PREFIX environment variable ignored by git config --system","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-01-29T18:20:34Z","receivedAt":"2025-01-29T18:20:43Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 29, 2025 11:42 AM, Junio C Hamano wrote:\n><rsbecker@nexbridge.com> writes:\n>\n>> Thank you for filling out a Git bug report!\n>>\n>> Please answer the following questions to help us understand your issue.\n>>\n>> What did you do before the bug happened? (Steps to reproduce your\n>> issue) export PREFIX=/home/randall git config --system --list\n>>\n>> What did you expect to happen? (Expected behavior) Git should use\n>> ${PREFIX}/etc/gitconfig instead of the build location to\n>\n>But that is now how PREFIX works, as far as I remember.  PREFIX is a\nbuild-time\n>thing.\n>\n>Perhaps you are looking for RUNTIME_PREFIX build-time option?  I do not\nknow\n>how well it is maintained these days, and if it allows you to futz with the\npaths at\n>runtime (without _moving_ the executable and all other installation\nmaterial en\n>masse), though.\n\nI did try that at runtime. No luck. I think we need to fix this.\n\n"},{"id":"511429","messageId":"xmqq5xlxidh6.fsf@gitster.g","threadId":"62870","inReplyTo":"008201db726f$6e6990b0$4b3cb210$@nexbridge.com","subject":"Re: [BUG] PREFIX environment variable ignored by git config --system","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-29T20:15:01Z","receivedAt":"2025-01-29T20:15:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<rsbecker@nexbridge.com> writes:\n\n> The documentation on the Environment Configuration page seems to imply that\n\nSorry, I am totally lost.  Whose documentation on what software are\nyou referring to?\n\n  $ git grep -i -e 'environment configuration' \n\ncomes back empty.\n\n"},{"id":"511432","messageId":"009c01db728d$164a60d0$42df2270$@nexbridge.com","threadId":"62870","inReplyTo":"xmqq5xlxidh6.fsf@gitster.g","subject":"RE: [BUG] PREFIX environment variable ignored by git config --system","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-01-29T20:33:36Z","receivedAt":"2025-01-29T20:33:45Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 29, 2025 3:15 PM, Junio C Hamano wrote:\n><rsbecker@nexbridge.com> writes:\n>\n>> The documentation on the Environment Configuration page seems to imply\n>> that\n>\n>Sorry, I am totally lost.  Whose documentation on what software are you\nreferring\n>to?\n>\n>  $ git grep -i -e 'environment configuration'\n>\n>comes back empty.\n\nIt is here:\nhttps://git-scm.com/book/ms/v2/Git-Internals-Environment-Variables\n\nA few paragraphs from the top.\n\n"},{"id":"511442","messageId":"xmqqwmedgpkf.fsf@gitster.g","threadId":"62870","inReplyTo":"009c01db728d$164a60d0$42df2270$@nexbridge.com","subject":"Re: [BUG] PREFIX environment variable ignored by git config --system","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-29T23:36:48Z","receivedAt":"2025-01-29T23:36:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<rsbecker@nexbridge.com> writes:\n\n> On January 29, 2025 3:15 PM, Junio C Hamano wrote:\n>><rsbecker@nexbridge.com> writes:\n>>\n>>> The documentation on the Environment Configuration page seems to imply\n>>> that\n>>\n>>Sorry, I am totally lost.  Whose documentation on what software are you\n> referring\n>>to?\n>>\n>>  $ git grep -i -e 'environment configuration'\n>>\n>>comes back empty.\n>\n> It is here:\n> https://git-scm.com/book/ms/v2/Git-Internals-Environment-Variables\n\nIt is news to me ;-).\n\n    $ git grep '[^_]PREFIX[^_]'\n\ndoes not have any hits in the source, so I do not see how we _could_\nbe paying any attention to such a thing.\n\nThe description seems to originate at\n\n  https://github.com/progit2-ms/progit2/commit/c24f22d6a6b0572f5756afd64f0c2e9fa6f804fa\n\nthat was more than 10 years old.  I do not know how reliable the\ndescription there is.\n\n\n"},{"id":"511443","messageId":"xmqqsep1gp0f.fsf@gitster.g","threadId":"62870","inReplyTo":"xmqqbjvpk1wo.fsf@gitster.g","subject":"Re: [BUG] PREFIX environment variable ignored by git config --system","fromName":"Junio C Hamano","fromEmail":"junio@pobox.com","sentAt":"2025-01-29T23:48:48Z","receivedAt":"2025-01-29T23:48:50Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> <rsbecker@nexbridge.com> writes:\n>>\n>>> Thank you for filling out a Git bug report!\n>>>\n>>> Please answer the following questions to help us understand your issue.\n>>>\n>>> What did you do before the bug happened? (Steps to reproduce your issue)\n>>> export PREFIX=/home/randall\n>>> git config --system --list\n>>>\n>>> What did you expect to happen? (Expected behavior)\n>>> Git should use ${PREFIX}/etc/gitconfig instead of the build location to\n>>\n>> But that is now how PREFIX works, as far as I remember.  PREFIX is a\n>> build-time thing.\n>\n> Sorry, I misspoke.\n>\n> I was talking about $(prefix) Makefile macro, that is all lowercase.\n"},{"id":"511444","messageId":"001201db72a8$72719480$5754bd80$@nexbridge.com","threadId":"62870","inReplyTo":"xmqqwmedgpkf.fsf@gitster.g","subject":"RE: [BUG] PREFIX environment variable ignored by git config --system","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-01-29T23:49:28Z","receivedAt":"2025-01-29T23:49:36Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 29, 2025 6:37 PM, Junio C Hamano wrote:\n><rsbecker@nexbridge.com> writes:\n>\n>> On January 29, 2025 3:15 PM, Junio C Hamano wrote:\n>>><rsbecker@nexbridge.com> writes:\n>>>\n>>>> The documentation on the Environment Configuration page seems to\n>>>> imply that\n>>>\n>>>Sorry, I am totally lost.  Whose documentation on what software are\n>>>you\n>> referring\n>>>to?\n>>>\n>>>  $ git grep -i -e 'environment configuration'\n>>>\n>>>comes back empty.\n>>\n>> It is here:\n>> https://git-scm.com/book/ms/v2/Git-Internals-Environment-Variables\n>\n>It is news to me ;-).\n>\n>    $ git grep '[^_]PREFIX[^_]'\n>\n>does not have any hits in the source, so I do not see how we _could_ be\npaying any\n>attention to such a thing.\n>\n>The description seems to originate at\n>\n>  https://github.com/progit2-\n>ms/progit2/commit/c24f22d6a6b0572f5756afd64f0c2e9fa6f804fa\n>\n>that was more than 10 years old.  I do not know how reliable the\ndescription there\n>is.\n\nThose of us who have written documentation for much of our lives, really\nmiss accuracy. There are companies where a wrong bit of documentation\nis considered as high severity defect. Regardless of that...\n\nt1300-config.sh has the following line in it:\n\nGIT_CONFIG_SYSTEM=write-to-system git config --system config.key value &&\n\nCould it mean that GIT_CONFIG_SYSTEM is actually what I am looking for?\n\n\n"},{"id":"511445","messageId":"xmqqfrl1gosc.fsf@gitster.g","threadId":"62870","inReplyTo":"001201db72a8$72719480$5754bd80$@nexbridge.com","subject":"Re: [BUG] PREFIX environment variable ignored by git config --system","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-29T23:53:39Z","receivedAt":"2025-01-29T23:53:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<rsbecker@nexbridge.com> writes:\n\n> Those of us who have written documentation for much of our lives, really\n> miss accuracy. There are companies where a wrong bit of documentation\n> is considered as high severity defect. Regardless of that...\n\nThe association with that \"book\" and those who hang around here is\nthat we could contribute corrections to them, as they are open\nsource and we are friends, but that is about it ;-).\n\nI am reasonably sure that they will appreciate a well researched\npull request (and \"well reserached\" does not mean \"somebody says\nthis is incorrect\" but needs a bit more than that).\n\nTHanks.\n"},{"id":"511446","messageId":"001501db72aa$fc812350$f58369f0$@nexbridge.com","threadId":"62870","inReplyTo":"xmqqfrl1gosc.fsf@gitster.g","subject":"RE: [BUG] PREFIX environment variable ignored by git config --system","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-01-30T00:07:38Z","receivedAt":"2025-01-30T00:07:46Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 29, 2025 6:54 PM, Junio C Hamano wrote:\n><rsbecker@nexbridge.com> writes:\n>\n>> Those of us who have written documentation for much of our lives,\n>> really miss accuracy. There are companies where a wrong bit of\n>> documentation is considered as high severity defect. Regardless of that...\n>\n>The association with that \"book\" and those who hang around here is that we could\n>contribute corrections to them, as they are open source and we are friends, but\n>that is about it ;-).\n>\n>I am reasonably sure that they will appreciate a well researched pull request (and\n>\"well reserached\" does not mean \"somebody says this is incorrect\" but needs a bit\n>more than that).\n\nWell, we are all friends here 😉 \n\nBe that as it may, the following seems to work:\n\n$ GIT_CONFIG_SYSTEM=/home/randall/etc/gitconfig git config --system --list\nfatal: unable to read config file '/home/randall/etc/gitconfig': No such file or directory\n\nThis appears to do exactly what I am looking for. When I create that file, git picks\nup config values from that file.The question is, is this environment variable actually\nsanctioned or is it just coincidence? It does exactly what I am looking for.\n\n"},{"id":"511447","messageId":"xmqqbjvpgnea.fsf@gitster.g","threadId":"62870","inReplyTo":"001501db72aa$fc812350$f58369f0$@nexbridge.com","subject":"Re: [BUG] PREFIX environment variable ignored by git config --system","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-30T00:23:41Z","receivedAt":"2025-01-30T00:23:43Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<rsbecker@nexbridge.com> writes:\n\n> This appears to do exactly what I am looking for. When I create that file, git picks\n> up config values from that file.The question is, is this environment variable actually\n> sanctioned or is it just coincidence? It does exactly what I am looking for.\n\nHow about reading \"git config --help\"?\n"},{"id":"511448","messageId":"001801db72af$20a35560$61ea0020$@nexbridge.com","threadId":"62870","inReplyTo":"xmqqbjvpgnea.fsf@gitster.g","subject":"RE: [BUG] PREFIX environment variable ignored by git config --system","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2025-01-30T00:37:17Z","receivedAt":"2025-01-30T00:37:24Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On January 29, 2025 7:24 PM, Junio C Hamano wrote:\n><rsbecker@nexbridge.com> writes:\n>\n>> This appears to do exactly what I am looking for. When I create that\n>> file, git picks up config values from that file.The question is, is\n>> this environment variable actually sanctioned or is it just coincidence?\nIt does\n>exactly what I am looking for.\n>\n>How about reading \"git config --help\"?\n\nYup. It's there, thanks. So should I figure out how to sync the website with\nthis\nor ignore it?\n\n"},{"id":"511523","messageId":"EC3D4518-9330-4D08-BFE9-0A45E71112C6@gmail.com","threadId":"62870","inReplyTo":"001801db72af$20a35560$61ea0020$@nexbridge.com","subject":"Re: [BUG] PREFIX environment variable ignored by git config --system","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-01-30T19:37:08Z","receivedAt":"2025-01-30T19:37:20Z","isPatch":false,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n\n> Le 29 janv. 2025 à 19:37, rsbecker@nexbridge.com a écrit :\n> \n> ﻿On January 29, 2025 7:24 PM, Junio C Hamano wrote:\n>> <rsbecker@nexbridge.com> writes:\n>> \n>>> This appears to do exactly what I am looking for. When I create that\n>>> file, git picks up config values from that file.The question is, is\n>>> this environment variable actually sanctioned or is it just coincidence?\n> It does\n>> exactly what I am looking for.\n>> \n>> How about reading \"git config --help\"?\n> \n> Yup. It's there, thanks. So should I figure out how to sync the website with\n> this\n> or ignore it?\n\nI often link less experienced Git users to git-scm.com, so I appreciate if it is fixed in some way. "},{"id":"511527","messageId":"xmqqldusarsa.fsf@gitster.g","threadId":"62870","inReplyTo":"001801db72af$20a35560$61ea0020$@nexbridge.com","subject":"Re: [BUG] PREFIX environment variable ignored by git config --system","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-01-30T21:57:41Z","receivedAt":"2025-01-30T21:57:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<rsbecker@nexbridge.com> writes:\n\n> On January 29, 2025 7:24 PM, Junio C Hamano wrote:\n>><rsbecker@nexbridge.com> writes:\n>>\n>>> This appears to do exactly what I am looking for. When I create that\n>>> file, git picks up config values from that file.The question is, is\n>>> this environment variable actually sanctioned or is it just coincidence?\n> It does\n>>exactly what I am looking for.\n>>\n>>How about reading \"git config --help\"?\n>\n> Yup. It's there, thanks. So should I figure out how to sync the website with\n> this\n> or ignore it?\n\nIt depends on how good a friend you are to them, right ;-)?\n\nhttps://github.com/progit/progit2/issues?q=is%3Aissue%20state%3Aopen%20PREFIX\n\nseems to say that the issue has not been reported, and doing so\nmight be a good first step.\n\nWe'd probably want a bit of history digging to see if we ever\nsupported \"$PREFIX/etc/gitconfig\" before opening that issue, though.\nHow to phrase the issue would be different between \"we used to but\nno longer support this since version X\" and \"we never supported such\na variable\".  This is a #leftoverbit for those without a lot of\ncoding skills but patience, being good at using \"git blame\", and a\ngood notetaking skills to summarize findings, are needed.\n\nAnother good thing to do is to match the environment variables and\ntheir descriptions we have in the output from \"git help git\" with\nthat page.  We may have acquired a few more of them since that page\nof the book was written 10 years ago, for example.  This would be a\ngood #leftoverbit for those without any coding experience but want\nto improve the documentation that exists in the overall ecosystem.\n\nThanks.\n\n"}]}