{"thread":{"id":"3095","subject":"New ref generates 8MB mail message","startedAt":"2006-01-18T14:09:07Z","lastAt":"2006-01-19T12:35:29Z","messageCount":3,"participants":["Matthew Wilcox","Linus Torvalds","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"14812","messageId":"20060118140907.GV19769@parisc-linux.org","threadId":"3095","inReplyTo":null,"subject":"New ref generates 8MB mail message","fromName":"Matthew Wilcox","fromEmail":"matthew@wil.cx","sentAt":"2006-01-18T14:09:07Z","receivedAt":"2006-01-18T14:09:07Z","isPatch":false,"sender":{"key":"matthew@wil.cx","avatar":null},"body":"\nThere's a bit of an unfortunate mistake in the default mail script\nthat causes making a new ref for Linus' kernel tree to generate an 8MB\nmail message.\n\nBased on the idea that a new branch is probably a branch off master, and\nif it isn't, then at least sending a log vs master is better than a log\nvs the beginning of time, I propose this patch:\n\ndiff --git a/templates/hooks--update b/templates/hooks--update\nindex 6db555f..609b4fe 100644\n--- a/templates/hooks--update\n+++ b/templates/hooks--update\n@@ -13,7 +13,7 @@ recipient=\"commit-list@example.com\"\n if expr \"$2\" : '0*$' >/dev/null\n then\n \techo \"Created a new ref, with the following commits:\"\n-\tgit-rev-list --pretty \"$3\"\n+\tgit-rev-list --pretty \"$3\" ^master\n else\n \tbase=$(git-merge-base \"$2\" \"$3\")\n \tcase \"$base\" in\n"},{"id":"14820","messageId":"Pine.LNX.4.64.0601180810330.3240@g5.osdl.org","threadId":"3095","inReplyTo":"20060118140907.GV19769@parisc-linux.org","subject":"Re: New ref generates 8MB mail message","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-01-18T16:12:16Z","receivedAt":"2006-01-18T16:12:16Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 18 Jan 2006, Matthew Wilcox wrote:\n> \n> Based on the idea that a new branch is probably a branch off master, and\n> if it isn't, then at least sending a log vs master is better than a log\n> vs the beginning of time, I propose this patch:\n\nActually, since the update hook _should_ be called before the ref has \nactually been updated, it's probably much better to instead of this:\n\n> -\tgit-rev-list --pretty \"$3\"\n> +\tgit-rev-list --pretty \"$3\" ^master\n\ndo something like this:\n\n\tgit-rev-list --pretty \"$3\" $(git-rev-parse --not --all)\n\nwhich basically says: show any commits that are in the new ref, but are \nnot in _any_ other ref.\n\nUntested, of course.\n\n\t\tLinus\n"},{"id":"14886","messageId":"43CF8791.6050705@op5.se","threadId":"3095","inReplyTo":"Pine.LNX.4.64.0601180810330.3240@g5.osdl.org","subject":"Re: New ref generates 8MB mail message","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2006-01-19T12:35:29Z","receivedAt":"2006-01-19T12:35:29Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Linus Torvalds wrote:\n> \n> On Wed, 18 Jan 2006, Matthew Wilcox wrote:\n> \n>>Based on the idea that a new branch is probably a branch off master, and\n>>if it isn't, then at least sending a log vs master is better than a log\n>>vs the beginning of time, I propose this patch:\n> \n> \n> Actually, since the update hook _should_ be called before the ref has \n> actually been updated, it's probably much better to instead of this:\n> \n> \n>>-\tgit-rev-list --pretty \"$3\"\n>>+\tgit-rev-list --pretty \"$3\" ^master\n> \n> \n> do something like this:\n> \n> \tgit-rev-list --pretty \"$3\" $(git-rev-parse --not --all)\n> \n> which basically says: show any commits that are in the new ref, but are \n> not in _any_ other ref.\n> \n> Untested, of course.\n> \n\nTested. It works fine and is, surprisingly, insanely fast.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"}]}