git commit mail script
Jannis Pohlmann
jannis at xfce.org
Mon Jun 22 14:37:30 CEST 2009
Hey,
I have a commit mail script working. It's run at the update stage and
sends
- one mail per commit
- one mail per newly created branch
- one mail per created tag (git push --tags)
this also means that if we merge two branches and don't use "git merge
--squash <source branch>", we may up with a lot of commit mails for the
merge destination branch. Not sure whether that's a good or bad thing.
I mean, it sounds kinda logical to me.
It also has another downside: It seems mails are sent with a
granularity of one second. So if you send two mails in the same second,
mail clients don't know in what order to display them. As a
consequence, the script requires a 1s timeout between the individual
mails. Now imagine I merge Thunar's migration-to-gio branch into
trunk ... the final push would take about two minutes ... well, unless
we figure out a way to disconnect the commit mail script from the shell
used for pushing. I tried "nohup <commit mail script> &" but that
always aborted after the first mail.
We want individual commit mails though. It's important for others to be
able to review the diffs of the individual commits.
Now, we could also use one commit mail per push. Implications of that:
- mail subjects are useless (what subject do you use if you have N > 1
commits bundled in one mail but only 1 subject?)
- we'd have to put the diffs of all commits into one mail (which is
messy)
I'd prefer the first solution (one mail per commit), but we need to
solve the timeout issue. For that we either have to disconnect the
commit mail script execution from the shell, or we need a cronjob +
lockfile to send commit mails periodically and let the commit mail hook
just dump the necessary information somewhere. Or we use a post-receive
hook but in those it's almost impossible (for me at least) to determine
which commits belong to a newly-created branch (at the update stage you
can check which commits don't belong to any ref yet, that's not
possible at post-receive).
Ideas, opinions?
- Jannis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20090622/42e8f48a/attachment.pgp>
More information about the Xfce4-dev
mailing list