threads / rfc / 28911

RFC patchRestore line limit option in post-receive-email

Subject: [PATCH/RFC] Restore line limit option in post-receive-email

## tl;dr

4 messages between Nov 11, 2011 and Jan 12, 2012. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Cheng Leong· Nov 11, 2011, 06:35 UTC · lore

The hooks.emailmaxlines config currently has no effect. Stop prep_for_email from clobbering the already-initialized maxlines variable in the contrib/hooks/post-receive-email example.

Signed-off-by: Cheng Leong <leongc@alumni.rice.edu>
---
 contrib/hooks/post-receive-email |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
Show changes to contrib/hooks/post-receive-email +0 −1
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index ba077c1..ac2e0ed 100755
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -85,7 +85,6 @@ prep_for_email()
 	oldrev=$(git rev-parse $1)
 	newrev=$(git rev-parse $2)
 	refname="$3"
-	maxlines=$4
 
 	# --- Interpret
 	# 0000->1234 (create)
-- 
1.7.7.1.msysgit.0
Junio C Hamano· Nov 11, 2011, 06:56 UTC · re: Cheng Leong · lore

Re: [PATCH/RFC] Restore line limit option in post-receive-email

Cheng Leong <leongc@alumni.rice.edu> writes:
Show 21 quoted lines
> The hooks.emailmaxlines config currently has no effect. Stop
> prep_for_email from clobbering the already-initialized maxlines
> variable in the contrib/hooks/post-receive-email example.
>
> Signed-off-by: Cheng Leong <leongc@alumni.rice.edu>
> ---
>  contrib/hooks/post-receive-email |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
> index ba077c1..ac2e0ed 100755
> --- a/contrib/hooks/post-receive-email
> +++ b/contrib/hooks/post-receive-email
> @@ -85,7 +85,6 @@ prep_for_email()
>  	oldrev=$(git rev-parse $1)
>  	newrev=$(git rev-parse $2)
>  	refname="$3"
> -	maxlines=$4
>  
>  	# --- Interpret
>  	# 0000->1234 (create)

Umm, there is another place where $maxlines is used without merit. Shouldn't we do something like below as well?

 contrib/hooks/post-receive-email |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to contrib/hooks/post-receive-email +1 −1
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index ba077c1..e27ca3c 100755
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -743,6 +743,6 @@ else
 	while read oldrev newrev refname
 	do
 		prep_for_email $oldrev $newrev $refname || continue
-		generate_email $maxlines | send_mail
+		generate_email | send_mail
 	done
 fi
Cheng Leong· Nov 11, 2011, 07:08 UTC · re: Junio C Hamano · lore

Re: [PATCH/RFC] Restore line limit option in post-receive-email

Junio C Hamano <gitster@pobox.com> wrote:
> Umm, there is another place where $maxlines is used without
> merit. Shouldn't we do something like below as well?
...
> -               generate_email $maxlines | send_mail
> +               generate_email | send_mail

Agree. $maxlines is harmless, but extraneous here. Would you like me to reroll a patch with both or is this a trivial fixup?

Cheng
Cheng Leong· Jan 12, 2012, 21:01 UTC · re: Cheng Leong · lore

Re: [PATCH/RFC] Restore line limit option in post-receive-email

> Would you like me to reroll a patch with both or is this a trivial fixup?
Bump. What do I need to do to contribute this patch?

Thanks, Cheng

← back to recent threads