#3195 fedorahosted projects commit emails can be huge
Closed: Fixed None Opened 12 years ago by simo.

= bug description =
When someone makes huge commits the commit email still includes the whole patch.

= bug analysis =
The commit hook should be smartened to recognize huge commits (say > 250k) and act differently when the threshold is reached.

= fix recommendation =

Two options:
1. just truncate after the diff summary that shows which files have been touched and how many lines have been changed and replace the actual commit diff with a link to the git web URL for the specific change and some text that explains the commit mail was truncated due to the commit being >this< big.

  1. As above but attach a gzip or similar with the original commit.

I prefer (1).


We are currently using the gnome post receive email hook.

I'm happy to entertain switching (some or all) projects to a better hook. Do you have pointers to such a hook?

Is there a project that we could test this on that often has large commits?

In SSSD and FreeIPA we regularly updated the translations and that often causes multimeg commits.
But I wouldn't say we do that "often". I think SSSD does it once every 3 months ?

ok.

I have setup git-notifier and it seems to do what you wish.

Do you have a project I can set it on and you can test it out and confirm it meets your needs?

No, I do not have any trash-able repositories :)
Don't you have a test repository on hosted on which these tests can be performed ?

Sorry to be unclear... I have tested it in a test repo. It works fine, but I'm not sure if you will like the format, etc.

So, there shouldn't be any loss of emails or anything, it's just more a matter of confirming it works for you format wise.

Is there a malinglist archive where I cans the the results of the test ?
Or maybe you can forward a couple of test emails to see the differnece against what we currently have ?

Here's one of my test commits to the fedorahosted fedbot repo:

{{{
To: kevin@fedoraproject.org
Subject: [fedbot] master: Yet another try. (ab820f8)
Date: Fri, 16 Mar 2012 18:09:14 +0000 (UTC)
X-Mailer: git-notifier 0.3

Repository : http://git.fedorahosted.org/git/?p=fedbot.git

On branch : master


commit ab820f84a06253937f426281ee210973a13cec7c
Author: Kevin Fenzi kevin@scrye.com
Date: Fri Mar 16 12:09:03 2012 -0600

Yet another try.

README | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/README b/README
index 29ca421..69c118c 100644
--- a/README
+++ b/README
@@ -1 +1,2 @@
This is a collection of plugins used by fedbot on freenode.
+
}}}

Looks good to me.
Is it something I can install in a repo on my own ? Or do we need to ask you ?

I think we need to set it up for you. It would be nice if there was a way to manage your own hooks, but currently there's not one. ;(

ok I'd like to install it on the sssd project, I am CCing Stephen so he can give an ack/nack on it and then we can proceed.

Ok, so reading the homepage for git-notifier, this should basically behave very similarly to what we have now, except that if we include the special string [nodiff] in the commit message, it will suppress the complete diff and only show the summary. That sounds good to me. I'll just have to get in the habit of always using that string when pushing translation updates.

Well, I was thinking of disabling the '[nodiff]' and '[nomail]' things. Many projects depend on commit emails, and that seems odd to allow bypassing.

The main difference here is that if the diff is larger than a config amount (default is 50k) it doesn't add the diff to the commit email, it instead tells you it was too large and to run 'git diff ...blah' to see the entire diff.

Ah, I didn't see the mention of it having an upper limit. That's fine with me.

ok. I enabled it on sssd.

Can you try it and see how you like it. I can easily revert back to the old one if you like.

No luck. I just pushed a patch to the master branch and did not receive an email about it.

huh. The log says:

Tue Mar 20 13:05:09 2012 - Running for /srv/git/sssd.git
Tue Mar 20 13:05:09 2012 - Initial run. Not generating any mails, just recording current state.

So, perhaps it will work right on the next commit? That seems odd tho.

Yeah, I just did another push and it seems to be working. I guess it must need to establish a baseline. Otherwise it would probably be sending an email for every commit up to that point.

I have a minor request.
Previously the commit script did not prepend [sssd] to the subject.
I find it confusing because [sssd] is also the tag used by dist-git for the sssd package (master branch).
This makes it hard to distinguish between upstream commits and package commits at a glance.
Can we have it removed or replaced by a tag that is more unique ?
I guess [sssd-git] would be fine with me.

For filtering purposes, I'm just filtering on "TO: gitsssd-members@fedoraproject.org"

That keeps it separate from dist-git for me.

We can change the tag to anything you like. ;)

I'll change it to [sssd-git]

Thanks a lot for all the work done!

No problem at all.

So, any further issues? Or shall we close this out? (and you can let us know when you want to enable it on any other repos).

I'll close this out now. If you want any other projects to use this hook or see problems, feel free to re-open this or file a new ticket and we will get it sorted. :)

Login to comment on this ticket.

Metadata