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

2017-03-13 Thread Devin Lehmacher
> 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" ;-). Ok, I will submit a new patch with a better explanation. Devin

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

2017-03-13 Thread Devin Lehmacher
> 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

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

2017-03-13 Thread Junio C Hamano
Jeff King 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); >> > + >> > +

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

2017-03-13 Thread Jeff King
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

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

2017-03-13 Thread Jeff King
On Mon, Mar 13, 2017 at 01:22:31PM -0400, Devin Lehmacher wrote: > Subject: Re: [GSoC][PATCH 2/3] credential-cache.c: Make git use > XDG_CACHE_HOME for credentials Another subject nitpick. :) Saying "Make git" is just extraneous. All commits make git do something. Likewise

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

2017-03-13 Thread Junio C Hamano
Devin Lehmacher writes: > +static char* get_socket_path(void) { By the way, in our codebase (which is C not C++), the asterisk does not stick to the type, i.e. the above should be: static char *get_socket_path(void) {

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

2017-03-13 Thread Junio C Hamano
Devin Lehmacher writes: > +static char* get_socket_path(void) { > + char *home_socket; > + > + home_socket = expand_user_path("~/.git_credential_cache/socket"); The typo on this line guarantees that nobody will retain the current location and will be migrated

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

2017-03-13 Thread Devin Lehmacher
git-credential-cache will now use the socket $XDG_CACHE_HOME/git/credential/socket if there is not already a socket at ~/.git-credential-cache/socket. This ensures that if another process already created a socket at the old location it will be used over the new one if it exists. Signed-off-by: