{"thread":{"id":"19845","subject":"hooks/post-receive-email bug?","startedAt":"2009-06-17T22:21:34Z","lastAt":"2009-07-07T15:14:13Z","messageCount":4,"participants":["Marc Branchaud","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"116508","messageId":"4A396C6E.2050600@xiplink.com","threadId":"19845","inReplyTo":null,"subject":"hooks/post-receive-email bug?","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2009-06-17T22:21:34Z","receivedAt":"2009-06-17T22:21:34Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"Hi all,\n\nWe currently have two main development branches: master and release.  These branches exist on our shared git server.  I had to make a change in both branches, so I made a topic branch off of their merge-base and did the work:\n\n  o--o--A--B--C\t\t<-- origin/master\n     |\\\n     | X--Y\t\t<-- origin/release\n      \\\n       1--2--3\t\t<-- topic\n\nI then merged topic into both master and release.  The merges were clean:\n\n  o--o--A--B--C---D\t<-- master\n     |\\           |\n     | X--Y----Z /\t<-- release\n      \\       / /\n       1--2--3--\t<-- topic\n\nThen I did\n\tgit push origin\nto push matching refspecs to the origin repo.\n\nport-receive-email sent two messages for that push, one for each branch.  Each message showed that commits 1, 2 and 3 were applied to the appropriate branch:\n\n\tThe branch, release has been updated\n\t       via  hash for Z (commit)\n\t       via  hash for 3 (commit)\n\t       via  hash for 2 (commit)\n\t       via  hash for 1 (commit)\n\t      from  hash for Y (commit)\n\nHowever, the details of the topic commits were missing from both messages.  Instead, both only contained the details of the merge commits D and Z.\n\nI was expecting at least one of the messages to have the details of commits 1, 2 and 3.  Was I wrong to expect that?\n\nThanks,\n\n\t\tM.\n"},{"id":"117508","messageId":"4A520EFA.10309@xiplink.com","threadId":"19845","inReplyTo":"4A396C6E.2050600@xiplink.com","subject":"Re: hooks/post-receive-email bug?","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2009-07-06T14:49:30Z","receivedAt":"2009-07-06T14:49:30Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"Ping?\n\n\t\tM.\n\n\nMarc Branchaud wrote:\n> Hi all,\n> \n> We currently have two main development branches: master and release. \n> These branches exist on our shared git server.  I had to make a change\n> in both branches, so I made a topic branch off of their merge-base and\n> did the work:\n> \n>  o--o--A--B--C        <-- origin/master\n>     |\\\n>     | X--Y        <-- origin/release\n>      \\\n>       1--2--3        <-- topic\n> \n> I then merged topic into both master and release.  The merges were clean:\n> \n>  o--o--A--B--C---D    <-- master\n>     |\\           |\n>     | X--Y----Z /    <-- release\n>      \\       / /\n>       1--2--3--    <-- topic\n> \n> Then I did\n>     git push origin\n> to push matching refspecs to the origin repo.\n> \n> port-receive-email sent two messages for that push, one for each\n> branch.  Each message showed that commits 1, 2 and 3 were applied to the\n> appropriate branch:\n> \n>     The branch, release has been updated\n>            via  hash for Z (commit)\n>            via  hash for 3 (commit)\n>            via  hash for 2 (commit)\n>            via  hash for 1 (commit)\n>           from  hash for Y (commit)\n> \n> However, the details of the topic commits were missing from both\n> messages.  Instead, both only contained the details of the merge commits\n> D and Z.\n> \n> I was expecting at least one of the messages to have the details of\n> commits 1, 2 and 3.  Was I wrong to expect that?\n> \n> Thanks,\n> \n>         M.\n"},{"id":"117561","messageId":"4A534E9F.3010303@drmicha.warpmail.net","threadId":"19845","inReplyTo":"4A520EFA.10309@xiplink.com","subject":"Re: hooks/post-receive-email bug?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-07-07T13:33:19Z","receivedAt":"2009-07-07T13:33:19Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Marc Branchaud venit, vidit, dixit 06.07.2009 16:49:\n> Ping?\n> \n\nPong!\n\nWhy not read the hook script yourself... but see below.\n\n> \t\tM.\n> \n> \n> Marc Branchaud wrote:\n>> Hi all,\n>>\n>> We currently have two main development branches: master and release. \n>> These branches exist on our shared git server.  I had to make a change\n>> in both branches, so I made a topic branch off of their merge-base and\n>> did the work:\n>>\n>>  o--o--A--B--C        <-- origin/master\n>>     |\\\n>>     | X--Y        <-- origin/release\n>>      \\\n>>       1--2--3        <-- topic\n>>\n>> I then merged topic into both master and release.  The merges were clean:\n>>\n>>  o--o--A--B--C---D    <-- master\n>>     |\\           |\n>>     | X--Y----Z /    <-- release\n>>      \\       / /\n>>       1--2--3--    <-- topic\n>>\n>> Then I did\n>>     git push origin\n>> to push matching refspecs to the origin repo.\n>>\n>> port-receive-email sent two messages for that push, one for each\n>> branch.  Each message showed that commits 1, 2 and 3 were applied to the\n>> appropriate branch:\n>>\n>>     The branch, release has been updated\n>>            via  hash for Z (commit)\n>>            via  hash for 3 (commit)\n>>            via  hash for 2 (commit)\n>>            via  hash for 1 (commit)\n>>           from  hash for Y (commit)\n>>\n>> However, the details of the topic commits were missing from both\n>> messages.  Instead, both only contained the details of the merge commits\n>> D and Z.\n>>\n>> I was expecting at least one of the messages to have the details of\n>> commits 1, 2 and 3.  Was I wrong to expect that?\n>>\n>> Thanks,\n>>\n>>         M.\n\nI assume that by \"pushing matching heads\" you mean you did not create a\ntopic branch on origin?\n\nThe hook tries cleverly to avoid sending multiple commit mails for the\nsame commit. The heuristics is not completely failsafe. It seems the\nhook thinks these commits have been dealt with already, which usually\nhappens when they can be reached by other refs than the one being updated.\n\nMichael\n"},{"id":"117564","messageId":"4A536645.70307@xiplink.com","threadId":"19845","inReplyTo":"4A534E9F.3010303@drmicha.warpmail.net","subject":"Re: hooks/post-receive-email bug?","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2009-07-07T15:14:13Z","receivedAt":"2009-07-07T15:14:13Z","isPatch":false,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"Michael J Gruber wrote:\n> \n> Why not read the hook script yourself... but see below.\n\nLaziness, obviously!  :)\n\n> I assume that by \"pushing matching heads\" you mean you did not create a\n> topic branch on origin?\n\nRight.  The push command pushed both merge commits to the origin, taking the topic commits along with them.\n\n> The hook tries cleverly to avoid sending multiple commit mails for the\n> same commit. The heuristics is not completely failsafe. It seems the\n> hook thinks these commits have been dealt with already, which usually\n> happens when they can be reached by other refs than the one being updated.\n\nThanks for confirming the issue.  Actually, I don't think the existence of a topic branch on the origin would've made a difference.  Like you say, the script ignores any commits reachable by any other branch.\n\nIt seems to me that the script might be able to keep track of which branches are being updated, and notice if two or more of them share commits.  But that may require a heavy rewrite...\n\nOne question: Is the reason the script sent two emails because git called it with two lines on stdin?  As in:\n\tC D master\n\tY Z release\n\n\t\tM.\n"}]}