{"thread":{"id":"62587","subject":"Support of NETRC environment variable","startedAt":"2024-12-02T17:36:47Z","lastAt":"2024-12-02T21:11:58Z","messageCount":2,"participants":["Rémi Debette","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"508455","messageId":"CAGinwDzTDexiXpwR0BGTTgX_9BcQ9N2RSea2UBTnyurCM0QRfg@mail.gmail.com","threadId":"62587","inReplyTo":null,"subject":"Support of NETRC environment variable","fromName":"Rémi Debette","fromEmail":"r.debette@instadeep.com","sentAt":"2024-12-02T17:36:34Z","receivedAt":"2024-12-02T17:36:47Z","isPatch":false,"sender":{"key":"r.debette@instadeep.com","avatar":null},"body":"Hi,\n\nThis email follows discussions on this issue in the uv project:\nhttps://github.com/astral-sh/uv/issues/9576\n\nThe uv project supports setting an environment variable called NETRC\nthat allows setting a path to a .netrc file if this one is not in the\nexpected home path ~/.netrc\nTheir documentation describes it here:\nhttps://docs.astral.sh/uv/configuration/environment/#netrc\n\ngit supports authenticating through the .netrc home file, but it seems\nit does not recognize this NETRC environment variable.\nWould there be an alternative way to set an alternate path?\n\nThank you\nRémi DEBETTE\n"},{"id":"508469","messageId":"20241202211156.GG776185@coredump.intra.peff.net","threadId":"62587","inReplyTo":"CAGinwDzTDexiXpwR0BGTTgX_9BcQ9N2RSea2UBTnyurCM0QRfg@mail.gmail.com","subject":"Re: Support of NETRC environment variable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2024-12-02T21:11:56Z","receivedAt":"2024-12-02T21:11:58Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Dec 02, 2024 at 06:36:34PM +0100, Rémi Debette wrote:\n\n> This email follows discussions on this issue in the uv project:\n> https://github.com/astral-sh/uv/issues/9576\n> \n> The uv project supports setting an environment variable called NETRC\n> that allows setting a path to a .netrc file if this one is not in the\n> expected home path ~/.netrc\n> Their documentation describes it here:\n> https://docs.astral.sh/uv/configuration/environment/#netrc\n> \n> git supports authenticating through the .netrc home file, but it seems\n> it does not recognize this NETRC environment variable.\n> Would there be an alternative way to set an alternate path?\n\nNo, there isn't. Git does not really support netrc itself[1]. But we do\nrely on libcurl for making http requests, and it handles it internally.\nThe only explicit thing Git does is turn on the libcurl option that\nallows the use of netrc.\n\nIt looks like curl also has a CURLOPT_NETRC_FILE option. So I think\nthere _could_ be a Git patch that takes the value from $NETRC and passes\nit there. But if this is a standard-ish interface, I wonder if it would\nmake more sense to lobby curl folks to support $NETRC automatically.\n\n-Peff\n\n[1] There's also a netrc credential helper in contrib/, but that may\n    defeat the purpose if you're looking for something people can just\n    use out of the box. They'd need to build and install the helper, and\n    then configure it.\n"}]}