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

Log message templates revisited.

From: <kfogel_at_collab.net>
Date: 2005-11-09 05:07:20 CET

I was talking to Jim Blandy today about the difficulty of designing a
good log message template system, and how it had led us into the
morass of inherited properties, which then turned out to be hard to
design properly.

He suggested a simpler way of doing things. I'm sure we must have
discussed it before, but perhaps if I present it anew here we'll
evaluate it with clean minds. (Well, except for Fitz.)

The whole attraction of inherited properties was that then the log
message template would be a directory property present on *every*
directory in your working copy tree. You'd have convenient access to
the template even when offline.

Jim's thought was to punt on offline access: just have the log message
template be a regular property, "svn:log-message-template", that gets
set on the top directory of the project to which the template applies.
When you commit, the client contacts the server with a new RA call,
propget_walking_upward(). You can guess where this is going... The
server starts at the path(s) involved in the commit, and walks upward
until it finds the lowest directory with an svn:l-m-t property.

(If cousin paths result in multiple "lowest" svn:l-m-t properties, we
just concatenate them or something. I feel morally justified
hand-waving on that right now -- we would have to deal with the same
problem with inherited properties, or indeed with just about any log
message template system, after all.)

Since you have to talk to the server to get the property, we lose the
intuitive, it-just-works offline construction of log messages. But
it's not so bad, there's a workaround -- you can still fetch the log
message template manually before you get on that airplane:

   $ svn pget --walk-upward-until-you-find-it svn:log-message-template URL

The option will have a better name, obviously, but you get the idea.

(You could also start a commit and then abort it, to get the template,
but the availability of the propget method helps convince me that this
proposal is not a kluge.)

This system is easy to implement and easy to explain. I volunteer to
implement it, if people think it's good.

I've left out various behavioral specifications (for example that the
template would show up in the editor launched by Subversion at commit
time), and have also left out some implementation details (for example
that newer clients could DTRT against older servers by performing the
upward walk themselves). Let's first get a thumbs-up-or-down on the
general proposal; I'll post a more detailed spec if the reaction is
positive.

This is probably obvious to everyone, but just in case: remember that
*enforcement* of log message templates is the job of pre-commit hooks,
and is already possible today. (And if the hook wanted to consult the
svn:l-m-t properties in the repository, it could, since the hook knows
the paths involved in the commit too.)

Okay, thoughts?

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 9 06:25:12 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.