{"thread":{"id":"33719","subject":"[RESEND/PATCH] transport-helper: improve push messages","startedAt":"2013-05-03T23:41:59Z","lastAt":"2013-05-05T17:59:20Z","messageCount":2,"participants":["Felipe Contreras","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"216381","messageId":"1367624519-12623-1-git-send-email-felipe.contreras@gmail.com","threadId":"33719","inReplyTo":null,"subject":"[RESEND/PATCH] transport-helper: improve push messages","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-03T23:41:59Z","receivedAt":"2013-05-03T23:41:59Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"If there's already a remote-helper tracking ref, we can fetch the SHA-1\nto report proper push messages (as opposed to always reporting\n[new branch]).\n\nThe remote-helper currently can specify the old SHA-1 to avoid this\nproblem, but there's no point in forcing all remote-helpers to be aware\nof git commit ids; they should be able to be agnostic of them.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\nReviewed-by: Jeff King <peff@peff.net>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\nI already sent this, but it has had the unfortunate luck of getting stuck with\na bunch of irrelevant patches in 'next'.\n\nThis is not only good enough for 'master', but probably even 'maint'.\n\n t/t5801-remote-helpers.sh | 14 ++++++++++++++\n transport-helper.c        |  1 +\n 2 files changed, 15 insertions(+)\n\ndiff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh\nindex 69212cd..dbb02e2 100755\n--- a/t/t5801-remote-helpers.sh\n+++ b/t/t5801-remote-helpers.sh\n@@ -186,4 +186,18 @@ test_expect_success GPG 'push signed tag with signed-tags capability' '\n \tcompare_refs local signed-tag-2 server signed-tag-2\n '\n \n+test_expect_success 'push messages' '\n+\t(cd local &&\n+\tgit checkout -b new_branch master &&\n+\techo new >>file &&\n+\tgit commit -a -m new &&\n+\tgit push origin new_branch &&\n+\tgit fetch origin &&\n+\techo new >>file &&\n+\tgit commit -a -m new &&\n+\tgit push origin new_branch 2> msg &&\n+\t! grep \"\\[new branch\\]\" msg\n+\t)\n+'\n+\n test_done\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 5f8d075..835815f 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -806,6 +806,7 @@ static int push_refs_with_export(struct transport *transport,\n \t\tif (private && !get_sha1(private, sha1)) {\n \t\t\tstrbuf_addf(&buf, \"^%s\", private);\n \t\t\tstring_list_append(&revlist_args, strbuf_detach(&buf, NULL));\n+\t\t\thashcpy(ref->old_sha1, sha1);\n \t\t}\n \t\tfree(private);\n \n-- \n1.8.3.rc0.401.g45bba44\n"},{"id":"216457","messageId":"7vip2xux3b.fsf@alter.siamese.dyndns.org","threadId":"33719","inReplyTo":"1367624519-12623-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [RESEND/PATCH] transport-helper: improve push messages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-05T17:59:20Z","receivedAt":"2013-05-05T17:59:20Z","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> I already sent this, but it has had the unfortunate luck of getting stuck with\n> a bunch of irrelevant patches in 'next'.\n>\n> This is not only good enough for 'master', but probably even 'maint'.\n\nWill apply for 1.8.3 (1.8.2.x may follow later).  Thanks for a\nreminder.\n"}]}