{"thread":{"id":"45350","subject":"[GSoC] Move ~/.git-credential-cache to ~/.cache/git","startedAt":"2017-03-10T23:46:10Z","lastAt":"2017-03-11T03:17:31Z","messageCount":5,"participants":["Devin Lehmacher","Jonathan Nieder","Noam Postavsky","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"313810","messageId":"8BE1A361-32BB-4164-AD54-949555855C52@cornell.edu","threadId":"45350","inReplyTo":null,"subject":"[GSoC] Move ~/.git-credential-cache to ~/.cache/git","fromName":"Devin Lehmacher","fromEmail":"djl329@cornell.edu","sentAt":"2017-03-10T23:30:55Z","receivedAt":"2017-03-10T23:46:10Z","isPatch":false,"sender":{"key":"djl329@cornell.edu","avatar":null},"body":"I started working on this microproject and am not quite sure what is necessary for backwards compatibility. Since the socket is recreated whenever the credential daemon exits backwards compatibility shouldn’t really be a concern with regard to where the socket is located in the filesystem.\n\nHowever, contrib/persistent-https depends on the socket being at ~/.git-credential-cache/socket, so changing the default location would break this. However, if we need to keep the socket at that location for cases like this I don’t understand how this change would be helpful in any way.\n\nIs it safe to change the default location for this socket and removing the original location?\n\nThanks in advanced,\nDevin Lehmacher\n"},{"id":"313812","messageId":"20170311002615.GG26789@aiede.mtv.corp.google.com","threadId":"45350","inReplyTo":"8BE1A361-32BB-4164-AD54-949555855C52@cornell.edu","subject":"Re: [GSoC] Move ~/.git-credential-cache to ~/.cache/git","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-03-11T00:26:15Z","receivedAt":"2017-03-11T00:26:23Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: npostavs)\nHi Devin,\n\nDevin Lehmacher wrote:\n\n> I started working on this microproject and am not quite sure what is\n> necessary for backwards compatibility. Since the socket is recreated\n> whenever the credential daemon exits backwards compatibility\n> shouldn’t really be a concern with regard to where the socket is\n> located in the filesystem.\n>\n> However, contrib/persistent-https depends on the socket being at\n> ~/.git-credential-cache/socket, so changing the default location\n> would break this. However, if we need to keep the socket at that\n> location for cases like this I don’t understand how this change\n> would be helpful in any way.\n\nThat's a good question.  If I'm reading contrib/persistent-https/\ncorrectly, it uses the same directory but doesn't rely on the socket\nthere, so it should not be a problem.\n\nHowever, that reminded me to search for other tools that might rely on\nthe socket.  Using\nhttps://codesearch.debian.net/search?q=%5C.git-credential-cache, I\nfind that magit does rely on the socket path.\n\n $ git clone https://github.com/magit/magit\n $ git log -S.git-credential-cache\n commit 0f30dfbb0075ac2e99b65a2c7fac360197a989c1\n Author: Noam Postavsky <npostavs@users.sourceforge.net>\n Date:   Sat Oct 24 15:57:54 2015 -0400\n\n    Start credential daemon on magit-credential-hook\n\n    If we let git start the daemon, Emacs will send a SIGHUP when git\n    finishes and closes the pty, killing the daemon.  Hence the need to have\n    our own daemon running first.\n\nCc-ing Noam to figure out what a safe transition will look like.\n\nThanks for noticing,\nJonathan\n"},{"id":"313815","messageId":"CAM-tV-9DV=XOVSehEfd2LiWYdubhwV7fC8uRnKqmFT_aTQ1OKg@mail.gmail.com","threadId":"45350","inReplyTo":"20170311002615.GG26789@aiede.mtv.corp.google.com","subject":"Re: [GSoC] Move ~/.git-credential-cache to ~/.cache/git","fromName":"Noam Postavsky","fromEmail":"npostavs@users.sourceforge.net","sentAt":"2017-03-11T01:02:18Z","receivedAt":"2017-03-11T01:02:25Z","isPatch":false,"sender":{"key":"npostavs@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/287742?v=4"},"body":"On Fri, Mar 10, 2017 at 7:26 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> I find that magit does rely on the socket path.\n>\n>     Start credential daemon on magit-credential-hook\n>\n>     If we let git start the daemon, Emacs will send a SIGHUP when git\n>     finishes and closes the pty, killing the daemon.  Hence the need to have\n>     our own daemon running first.\n\nMagit doesn't really care about the particular path, but it does call\ngit-credential-cache--daemon directly which needs to be told where to\ncreate the socket. I guess Magit could just default to using\n~/.cache/git/socket if ~/.cache/git exists? (Magit users can override\nthe path regardless)\n"},{"id":"313816","messageId":"3B988055-D8A3-43B7-BF5F-C43479EF7BEB@cornell.edu","threadId":"45350","inReplyTo":"CAM-tV-9DV=XOVSehEfd2LiWYdubhwV7fC8uRnKqmFT_aTQ1OKg@mail.gmail.com","subject":"Re: [GSoC] Move ~/.git-credential-cache to ~/.cache/git","fromName":"Devin Lehmacher","fromEmail":"djl329@cornell.edu","sentAt":"2017-03-11T02:27:23Z","receivedAt":"2017-03-11T02:27:33Z","isPatch":false,"sender":{"key":"djl329@cornell.edu","avatar":null},"body":"If I’m not mistaken magit won’t stop working with the changed location since it will just spawn an new instance of the daemon. The only downside would be it wouldn’t get credentials that were cached in the default socket.\n\nI am going to move forward with git-credential-cache just using the new location at\n`~/.cache/git/credential/socket` and submit a patch and then get more feedback on the patch.\n\nDevin Lehmacher\n"},{"id":"313817","messageId":"xmqqinngwlhr.fsf@gitster.mtv.corp.google.com","threadId":"45350","inReplyTo":"3B988055-D8A3-43B7-BF5F-C43479EF7BEB@cornell.edu","subject":"Re: [GSoC] Move ~/.git-credential-cache to ~/.cache/git","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-11T03:17:04Z","receivedAt":"2017-03-11T03:17:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Devin Lehmacher <djl329@cornell.edu> writes:\n\n> If I’m not mistaken magit won’t stop working with the changed\n> location since it will just spawn an new instance of the\n> daemon. The only downside would be it wouldn’t get credentials\n> that were cached in the default socket.\n\nI am not quite sure how you can say \"only\" in that sentence.  Isn't\nthe whole point of socket based daemon interface to allow starting\nthe daemon so that it can keep using it?\n\nSomebody upthread mentioned checking the current location (and use\nit if there is) and then use the new location, which I found a more\nreasonable approach.\n\nAssuming that it is sensible to move it from ~/.git-credential-cache\nto ~/.cache/git/ in the first place, that is.  If both are equally\nacceptable places, then perhaps a configuration that allows those\nwho want to have things in ~/.config/git/ to specify where to have\nthe thing (and those without such a custom configuration will keep\nusing the current location) may be more appropriate.\n"}]}