On 26/01/2009, at 15.33, Greg Stein wrote:
> On Mon, Jan 26, 2009 at 14:02, Jon Bendtsen <jbendtsen_at_laerdal.dk>
> wrote:
>> Hi Greg (and others)
>>
>> I have been thinking about how to split the path apart and how to
>> identify
>> which parts of the path should actually be included into the
>> headers of the
>> email. I came up with the idea of having 2 configuration variables.
>>
>> Some examples:
>> Actual path = trunk/tools/hook-scripts/mailer/
>> mailer.py
>> headers_path = branch/module/.../file
>> email_headers = author group module file
>> notice how the branch field is not included in the header.
>> module = tools
>> file = mailer.py
>>
>>
>> Actual path = trunk/tools/hook-scripts/mailer/
>> mailer.py
>> headers_path = branch/module/.../directory/file
>> email_headers = author group module file directory branch
>> branch = trunk
>> module = tools
>> directory = mailer
>> file = mailer.py
>>
>> the ... part signals that this part of the path should be ignored.
>> However, suppose we have a path definition like:
>>
>> Actual path = trunk/tools/hook-scripts/mailer/
>> mailer.py
>> headers_path = branch/module/submod/.../directory/subdir/
>> file
>> branch = trunk
>> module = tools
>> submod = hook-scripts
>> file = mailer.py
>> subdir = mailer
>> directory = hookscripts
>>
>> Notice how both directory and submod has the value hook-scripts
>>
>> What i want to do is start parsing the path, and then i will parse
>> the
>> headers_path and assign values until i reach ... or the end
>> After this i start from the back and assign values until i reach ...
>>
>> You dont need to have ... in the path, but if you do have it, it
>> can not be
>> both first and last. But you could write a path like this
>>
>> headers_path =
>> branch/module/submod/.../foobar/.../directory/subdir/file
>> then you can just never assign the foobar value.
>>
>> The configuration parameter email_headers then actually determines
>> which of
>> the values from the path should be included.
>>
>> So, how do you like it?
>
> I like it, and suggested something similar with one primary
> difference:
>
> * use "_" to signal a path segment that will not be named/used.
> Anything that gets named will go into the headers. I would also
> suggest that we *always* add X-SVN-Author to the mail headers, rather
> than making that configurable.
What about the group header? it is the [group] in the configuration
file.
> This drops your two configuration variables to just one.
>
> I would also suggest *not* allowing two "..." segments. I don't see
> any utility in that, so would disallow it.
Actually i dont mind 2 ... because i start from the front and stop
once i reach the end of the list or the first ...
Then i start from the rear and continue until either ... or the
beginning of the list.
I did not plan to test for 2 ...
JonB
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1058580
Received on 2009-01-27 12:43:23 CET