Re: Support of NETRC environment variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 02, 2024 at 06:36:34PM +0100, Rémi Debette wrote:

> This email follows discussions on this issue in the uv project:
> https://github.com/astral-sh/uv/issues/9576
> 
> The uv project supports setting an environment variable called NETRC
> that allows setting a path to a .netrc file if this one is not in the
> expected home path ~/.netrc
> Their documentation describes it here:
> https://docs.astral.sh/uv/configuration/environment/#netrc
> 
> git supports authenticating through the .netrc home file, but it seems
> it does not recognize this NETRC environment variable.
> Would there be an alternative way to set an alternate path?

No, there isn't. Git does not really support netrc itself[1]. But we do
rely on libcurl for making http requests, and it handles it internally.
The only explicit thing Git does is turn on the libcurl option that
allows the use of netrc.

It looks like curl also has a CURLOPT_NETRC_FILE option. So I think
there _could_ be a Git patch that takes the value from $NETRC and passes
it there. But if this is a standard-ish interface, I wonder if it would
make more sense to lobby curl folks to support $NETRC automatically.

-Peff

[1] There's also a netrc credential helper in contrib/, but that may
    defeat the purpose if you're looking for something people can just
    use out of the box. They'd need to build and install the helper, and
    then configure it.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux