{"thread":{"id":"22410","subject":"[PATCH] Fix remote.<remote>.vcs","startedAt":"2010-01-27T16:16:17Z","lastAt":"2010-01-27T17:18:21Z","messageCount":3,"participants":["Ilari Liusvaara","Sverre Rabbelier"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"132803","messageId":"1264608977-20665-1-git-send-email-ilari.liusvaara@elisanet.fi","threadId":"22410","inReplyTo":null,"subject":"[PATCH] Fix remote.<remote>.vcs","fromName":"Ilari Liusvaara","fromEmail":"ilari.liusvaara@elisanet.fi","sentAt":"2010-01-27T16:16:17Z","receivedAt":"2010-01-27T16:16:17Z","isPatch":true,"sender":{"key":"ilari.liusvaara@elisanet.fi","avatar":null},"body":"remote.<remote>.vcs causes remote->foreign_vcs to be set on entry to\ntransport_get(). Unfortunately, the code assumed that any such entry\nis stale from previous round. Resetting after starting the remote helper\navoids that case (it isn't likely anyone is using VCS setting and multiple\npush URLs, as VCS setting is meant for non-URL-based helpers).\n\nSigned-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>\n---\n transport.c |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\nTor, does this also fix the segfault for you? This might work without\nbreaking some multiple-URL cases (just commenting out the reset will break\nthem).\n\ndiff --git a/transport.c b/transport.c\nindex 7714fdb..76b22e5 100644\n--- a/transport.c\n+++ b/transport.c\n@@ -923,9 +923,6 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \t\turl = remote->url[0];\n \tret->url = url;\n \n-\t/* In case previous URL had helper forced, reset it. */\n-\tremote->foreign_vcs = NULL;\n-\n \t/* maybe it is a foreign URL? */\n \tif (url) {\n \t\tconst char *p = url;\n@@ -938,6 +935,7 @@ struct transport *transport_get(struct remote *remote, const char *url)\n \n \tif (remote && remote->foreign_vcs) {\n \t\ttransport_helper_init(ret, remote->foreign_vcs);\n+\t\tremote->foreign_vcs = NULL;\n \t} else if (!prefixcmp(url, \"rsync:\")) {\n \t\tret->get_refs_list = get_refs_via_rsync;\n \t\tret->fetch = fetch_objs_via_rsync;\n-- \n1.7.0.rc0.19.gd681a\n"},{"id":"132806","messageId":"fabb9a1e1001270822u7727b0fdq3270ee5bb3ce546c@mail.gmail.com","threadId":"22410","inReplyTo":"1264608977-20665-1-git-send-email-ilari.liusvaara@elisanet.fi","subject":"Re: [PATCH] Fix remote.<remote>.vcs","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-01-27T16:22:07Z","receivedAt":"2010-01-27T16:22:07Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Jan 27, 2010 at 17:16, Ilari Liusvaara\n<ilari.liusvaara@elisanet.fi> wrote:\n> it isn't likely anyone is using VCS setting and multiple\n> push URLs, as VCS setting is meant for non-URL-based helpers\n\nI don't like that assumption, I've used the vcs setting with regular\nurls myself, is there a different way to solve this without\nintroducing that assumption? Also, what happens if one _does_ do that,\ndo we crash? abort?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"132813","messageId":"20100127171821.GB20820@Knoppix","threadId":"22410","inReplyTo":"fabb9a1e1001270822u7727b0fdq3270ee5bb3ce546c@mail.gmail.com","subject":"Re: [PATCH] Fix remote.<remote>.vcs","fromName":"Ilari Liusvaara","fromEmail":"ilari.liusvaara@elisanet.fi","sentAt":"2010-01-27T17:18:21Z","receivedAt":"2010-01-27T17:18:21Z","isPatch":true,"sender":{"key":"ilari.liusvaara@elisanet.fi","avatar":null},"body":"On Wed, Jan 27, 2010 at 05:22:07PM +0100, Sverre Rabbelier wrote:\n> Heya,\n> \n> On Wed, Jan 27, 2010 at 17:16, Ilari Liusvaara\n> <ilari.liusvaara@elisanet.fi> wrote:\n> > it isn't likely anyone is using VCS setting and multiple\n> > push URLs, as VCS setting is meant for non-URL-based helpers\n> \n> I don't like that assumption, I've used the vcs setting with regular\n> urls myself, is there a different way to solve this without\n> introducing that assumption? Also, what happens if one _does_ do that,\n> do we crash? abort?\n\nIf you have url-based remote helper, then use the <helper>::<URL> syntax.\n\nAs for what would happen: If you don't override with URL, the first\nURL would use remote helper specified by vcs setting.\n\nMaybe it would be better idea to have vcs setting set the default\nhelper (that gets used unless you override?)\n\n-Ilari\n"}]}