Web lists-archives.com

Re: [GSoC][PATCH 2/3] credential-cache.c: Make git use XDG_CACHE_HOME for credentials




Jeff King <peff@xxxxxxxx> writes:

> On Mon, Mar 13, 2017 at 11:09:11AM -0700, Junio C Hamano wrote:
>
>> > +	if (home_socket)
>> > +		if (file_exists(home_socket))
>> > +			return home_socket;
>> > +		else
>> > +			free(home_socket);
>> > +
>> > +	return xdg_cache_home("credential/socket");
>> > +}
>> 
>> I somehow feel that the order of precedence should be the other way
>> around, though.  
>> 
>> If somebody really wants to use the xdg location and has a socket
>> already there, using that existing socket would be the right thing
>> to do.  However, when neither ~/.git-credential-cache/socket nor
>> ~/.cache/git/socket exists, why should we prefer the latter over the
>> former?
>
> How would they get a socket in the xdg location if we never create one?

They wouldn't.  It was my oblique way to say "it is unclear from the
patch description and the code why this is a good idea---it needs to
be explained better" ;-).