[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Limit size of emails sent using commit-email.pl

From: <kfogel_at_collab.net>
Date: 2005-01-21 18:26:07 CET

VK Sameer <sameer@collab.net> writes:
> > 1. Have a diff-size limit (or body-size limit) on post-commit
> > emails. Some reasonable default would be built-in, but it could
> > be overridden from the command line, e.g.,
> > $ commit-email.pl --diff-limit=256k
> Will add this.

Cool -- glad to know this passes another person's sanity filter.

> > 2. Take a new parameter with value, --diff-alternative. If the
> > diff limit is exceeded, *none* of the diff is included inline,
> > and the value of the --diff-alternative is used instead, e.g.:
> > $ commit-email.pl --diff-limit=256k \
> > --diff-alternative='http://.../?view=rev&rev=12798'
> > Where did that URL with its revision number come from? Simple: it's
> > the responsibility of the caller to construct the entire URL,
> > including the revnum and whatever other information is needed. That
> > is, no tool-specific knowledge would be encoded into commit-email.pl.
> > There's not even any requirement that the diff alternative be a URL
> > (though surely it would be in 99% of cases).
> I think it will work for ViewCVS if post-commit
> calls commit-email.pl like this (ignoring quoting issues):
> YOUNGEST=svnlook youngest <repos>
> commit-email.pl --diff-alternative="http://.../?view=rev&rev=$YOUNGEST"
> Something similar would have to done for other applications. BTW,
> providing the URL is a good idea and the only reason I didn't put it
> into the patch (and thereby catching the flak from Mike ;)) is because
> I couldn't figure out how to build the URL.

Fortunately, that's not commit-email.pl's job. It can assume that the
caller can construct the URL, no matter how complex a job that is.
(Because the alternative is for commit-email.pl to do it, and if
commit-email.pl can do it, so could its caller -- they're both just
programs, right?).

> > If the diff limit were exceeded, the text given in the commit email
> > would be something like this:
> > http://svn.collab.net/viewcvs/svn/?view=rev&rev=12798
> > (Diff too large to include in this mail. Please see above.)
> > And if the diff limit were not exceeded, we would *still* include the
> > diff-alternative, because it might be handy for people to pass around:
> OK. That means modifying whatever generates post-commit.tmpl to
> use --diff-alternative when calling commit-email.pl, right?
> commit-email.pl will use that option as is then. Another option is to
> put a default into commit-email.pl.in.

We don't need to modify post-commit.tmpl, though we could. It's just
an example. People do all sorts of weird, complex things in their
hook scripts, things that have never been included in the .tmpl files.

> If we go by Mike's point of not favouring a specific tool, though, the
> --diff-alternative would be documented, but not provided in the
> template script. Maybe commented out?

Hint: stop thinking about the post-commit template script :-). It's
irrelevant to this issue.

The point is to give commit-email.pl the ability to use a certain
piece of information that will be passed to it verbatim. Coming up
with that information is someone else's job (we know it can be done,
of course, but actually doing it is not part of this change).


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 21 18:35:50 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.