Skip to contentSkip to conversation

New ref generates 8MB mail message

PATCH Matthew Wilcox 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

There's a bit of an unfortunate mistake in the default mail script that causes making a new ref for Linus' kernel tree to generate an 8MB mail message.

Based on the idea that a new branch is probably a branch off master, and if it isn't, then at least sending a log vs master is better than a log vs the beginning of time, I propose this patch:

templates/hooks--update +1 -1
index 6db555f..609b4fe 100644
@@ -13,7 +13,7 @@ recipient="[email protected]"
 if expr "$2" : '0*$' >/dev/null
 then
 	echo "Created a new ref, with the following commits:"
-	git-rev-list --pretty "$3"
+	git-rev-list --pretty "$3" ^master
 else
 	base=$(git-merge-base "$2" "$3")
 	case "$base" in
#1 lore raw
Quoted 4 lines · Matthew Wilcox

Based on the idea that a new branch is probably a branch off master, and if it isn't, then at least sending a log vs master is better than a log vs the beginning of time, I propose this patch:

Actually, since the update hook _should_ be called before the ref has actually been updated, it's probably much better to instead of this:

templates/hooks--update recipient="[email protected]" · line 16

Quoted 2 lines
templates/hooks--update +1 -1
-	git-rev-list --pretty "$3"
+	git-rev-list --pretty "$3" ^master

do something like this:

	git-rev-list --pretty "$3" $(git-rev-parse --not --all)

which basically says: show any commits that are in the new ref, but are not in _any_ other ref.

Untested, of course.

Linus

#2 lore raw
Quoted 17 lines · Linus Torvalds
Quoted 3 lines · Matthew Wilcox

Based on the idea that a new branch is probably a branch off master, and if it isn't, then at least sending a log vs master is better than a log vs the beginning of time, I propose this patch:

Actually, since the update hook _should_ be called before the ref has actually been updated, it's probably much better to instead of this:

templates/hooks--update recipient="[email protected]" · line 16

Quoted 2 lines
templates/hooks--update +1 -1
-	git-rev-list --pretty "$3"
+	git-rev-list --pretty "$3" ^master

do something like this:

Quoted 6 lines
	git-rev-list --pretty "$3" $(git-rev-parse --not --all)

which basically says: show any commits that are in the new ref, but are not in _any_ other ref.

Untested, of course.

Tested. It works fine and is, surprisingly, insanely fast.

Signature · 3 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231