{"thread":{"id":"33882","subject":"[PATCH] transport-helper: barf when user tries old:new","startedAt":"2013-05-21T01:02:45Z","lastAt":"2013-05-21T21:12:09Z","messageCount":3,"participants":["Felipe Contreras","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"218027","messageId":"1369098165-8727-1-git-send-email-felipe.contreras@gmail.com","threadId":"33882","inReplyTo":null,"subject":"[PATCH] transport-helper: barf when user tries old:new","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-21T01:02:45Z","receivedAt":"2013-05-21T01:02:45Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Otherwise with certain remote helpers (the ones that support 'export'),\nthe users will be pushing to the wrong branch:\n\n  git push topic:master\n\nWill push the topic branch, as if the user typed:\n\n  git push topic\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n\nI did fix this properly, but was beaten by shoots from the hip[1]. I won't\nbother rationalizing if this makes sense for 'master', or writing tests. This\npatch can't possibly make anything worst. If somebody is interested, there's\nproper fix: [1], with explanation, tests, and everything.\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/223706\n\n transport-helper.c | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 522d791..a782a9b 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -813,9 +813,11 @@ static int push_refs_with_export(struct transport *transport,\n \t\t\tdie(\"remote-helpers do not support ref deletion\");\n \t\t}\n \n-\t\tif (ref->peer_ref)\n+\t\tif (ref->peer_ref) {\n+\t\t\tif (strcmp(ref->peer_ref->name, ref->name))\n+\t\t\t\tdie(\"remote-helpers do not support old:new syntax\");\n \t\t\tstring_list_append(&revlist_args, ref->peer_ref->name);\n-\n+\t\t}\n \t}\n \n \tif (get_exporter(transport, &exporter, &revlist_args))\n-- \n1.8.3.rc3.1.gf572ce5.dirty\n"},{"id":"218055","messageId":"7v7gisqonp.fsf@alter.siamese.dyndns.org","threadId":"33882","inReplyTo":"1369098165-8727-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH] transport-helper: barf when user tries old:new","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-21T16:32:42Z","receivedAt":"2013-05-21T16:32:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> Otherwise with certain remote helpers (the ones that support 'export'),\n> the users will be pushing to the wrong branch:\n>\n>   git push topic:master\n>\n> Will push the topic branch, as if the user typed:\n>\n>   git push topic\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>\n> I won't\n> bother rationalizing if this makes sense for 'master'\n\nAs this is a change to an old code/behaviour that was with us with\nmany released versions, it hardly is for 'master' during -rc period.\n\nI think your dry-run one (the reroll) is a good fix but for the same\nreason I'd rather see us apply after 1.8.3 final.\n"},{"id":"218095","messageId":"CAMP44s2EbKxqCFepnBj82oprz9WDWqS935w-fXFRHxrh+ng7kA@mail.gmail.com","threadId":"33882","inReplyTo":"7v7gisqonp.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] transport-helper: barf when user tries old:new","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-21T21:12:09Z","receivedAt":"2013-05-21T21:12:09Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, May 21, 2013 at 11:32 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n>> I won't\n>> bother rationalizing if this makes sense for 'master'\n>\n> As this is a change to an old code/behaviour that was with us with\n> many released versions, it hardly is for 'master' during -rc period.\n\nProbably.\n\n-- \nFelipe Contreras\n"}]}