<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 25, 2013 at 2:06 PM, Sebastian Pop <span dir="ltr"><<a href="mailto:spop@codeaurora.org" target="_blank">spop@codeaurora.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Sebastian Pop wrote:<br>
> Hi Daniel,<br>
><br>
> Daniel Dunbar wrote:<br>
> > Hi Sebastion,<br>
> ><br>
> > I've attached the current configuration file from the server.<br>
> ><br>
> > I'm not sure how far you want to go down the "trying to get realize nice<br>
> > summary path" lines, but if svn_mailer somehow supported running an<br>
> > external script to process the commit and come up with the path that would<br>
> > be ideal for integration on the server.<br>
><br>
> I think you could modify the sources of svn_mailer to add such a hook. When I<br>
> first investigated this issue, I ended on a bug report from the debian project<br>
> that fixed the subject line with a one line patch:<br>
><br>
> > To get the first line of the log message as a subject line, please apply this<br>
> > one line patch: <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=17;bug=379534" target="_blank">http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=17;bug=379534</a><br>
> > Note that you can directly patch the installed script: on my machine it is<br>
> > located in /usr/local/lib/python2.7/dist-packages/svnmailer/notifier/_mail.py<br>
><br>
> For your convenience, here is the patch from that debian bug report:<br>
><br>
><br>
> svnmailer: add log substitution for subject templates<br>
><br>
> Add first line of commit log as a substitution variable for<br>
> *_subject_template, E.G. add %(log)s to use.<br>
><br>
> Signed-off-by: Peter Korsgaard <<a href="mailto:jacmet@sunsite.dk">jacmet@sunsite.dk</a>><br>
><br>
> Index: svnmailer-1.0.8/src/lib/svnmailer/notifier/_mail.py<br>
> ===================================================================<br>
> --- svnmailer-1.0.8.orig/src/lib/svnmailer/notifier/_mail.py 2008-05-27 14:56:27.000000000 +0200<br>
> +++ svnmailer-1.0.8/src/lib/svnmailer/notifier/_mail.py 2008-05-27 15:01:50.000000000 +0200<br>
> @@ -314,6 +314,7 @@<br>
> 'part' : countprefix,<br>
> 'files' : self._getPrefixedFiles(changeset),<br>
> 'dirs' : self._getPrefixedDirectories(changeset),<br>
> + 'log' : self.getLog().split('\n',1)[0],<br>
> }<br>
><br>
> # We may try twice, first with files/dirs = files<br>
><br>
><br>
<br>
</div></div>Once you patched the installed version of this file, in<br>
/usr/local/lib/python2.7/dist-packages/svnmailer/notifier/_mail.py<br>
you have two more changes in the config file you sent me: (the first change to<br>
print the context of diff is something that I was missing more than the subject)<br></blockquote><div><br></div><div style>I'm a bit hesitant to just hack up the installed copy of svnmailer, are we sure this patch hasn't been dealt with in an upstream version?</div>
<div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
--- svn-mailer.conf.orig 2013-01-25 15:39:23.000000000 -0600<br>
+++ svn-mailer.conf 2013-01-25 15:42:02.000000000 -0600<br>
@@ -1,6 +1,6 @@<br>
[general]<br>
sendmail_command = /usr/sbin/sendmail<br>
-diff_command = /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %(to)s<br>
+diff_command = /usr/bin/diff -up -L %(label_from)s -L %(label_to)s %(from)s %(to)s<br>
generate_diffs = add copy modify propchange<br></blockquote><div><br></div><div style>I'll go ahead and make this change.</div><div style><br></div><div style> - Daniel</div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
[authors]<br>
@@ -360,6 +360,7 @@<br>
mail_type = single<br>
show_applied_charset = nondefault<br>
custom_header = SVN-Repository %(REPOS)s<br>
+commit_subject_template = %(prefix)s r%(revision)s - %(log)s<br>
<br>
[branch]<br>
for_repos = .*/llvm-project$<br>
<br>
<br>
<br>
Note that I have not addressed the path prefix suggestion from David:<br>
<div class="im"><br>
>>> For what it's worth, (I think) Chris' suggestion of including the<br>
>>> directories was about including them "smart"ly by removing conceptual<br>
>>> duplicates (lib/foo + include/foo + test/foo) and generally giving a<br>
>>> brief sense of what a change is touching. If the change you have adds<br>
>>> the full (repo-relative) path all the directories without any smart<br>
>>> deduplication then I suspect it's going to easily push the log<br>
>>> description off most mail readers (especially mobile) & reduce the<br>
>>> value of this change.<br>
>>><br>
>>> I suspect we'll want to just stick with revision + log for now.<br>
>><br>
>> That's fine. Alternatively we can provide a list of all the dirs that we want<br>
>> to see appearing and match them like this:<br>
>><br>
>> for_paths = .*(?P<SelectDirs>(lib/Analysis|lib/Transforms/Vectorize|lib/Transforms/Scalar)).*<br>
>><br>
>> commit_subject_template = %(prefix)s r%(revision)s - [%(SelectDirs)s] %(log)s<br>
><br>
>Could we go one step further and map these paths to names (eg: map<br>
>"lib/Analysis", "include/llvm/Analysis", "test/Analysis" -> "Analysis"<br>
>and unique the results)? Also, I'd prefer to have the dirs after the<br>
>log message I think, though perhaps if we get them short enough it'd<br>
>work.<br>
><br>
>This solution does seem like it could involve a bit of manual work to<br>
>update the list of blessed dirs all the time. If we could express it<br>
>generically (lib/*, test/*, include/llvm/*) it might be OK, but as it<br>
>stands I'm still not sure it's worth the hassle.<br>
<br>
</div>This could be done as Daniel has suggested, running a separate script that<br>
filters and classifies in a smarter way the commits following the paths they are<br>
touching.<br>
<br>
Thanks,<br>
<div class="HOEnZb"><div class="h5">Sebastian<br>
--<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation<br>
</div></div></blockquote></div><br></div></div>