Re: format of svn:author
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 4 Jan 2012 18:42:30 +0000 (GMT)
I think I can see to some extent what you are getting at, but not clearly. We all need a common frame of reference for understanding why and how some sort of extended author information could be useful. To help us get there, I put
Please note that this draft is purely an invention of my mind and I do not expect it to be an accurate reflection of your or anyone else's requirements.
A PROPOSAL FOR EXTENDED AUTHOR IDENTIFICATION
1.[This one I am aware of.]
A large company has authenticated user ids that are numeric. That means the "log" and "blame" information shown by most Subversion clients is not easy to understand. Therefore they use a (post-commit?) hook to change
2. [This one is a guess.]
The leader of a small development team sharing a Subversion repository with other teams wants to set up a build slave that will send an email to the users who committed revisions leading to a build failure. The machine can see the Subversion user id but how can it get the user's email address? The team leader could ask the repository administrator to add a post-commit hook that adds an email address to a revision property after every commit, but that
* requires involving the server admin;
3. [This one is a guess.]
An administrator wants to integrate Subversion with an issue tracker. Users have different user ids on the two tools. The admin wants to configure the tracker so that it automatically annotates an already committed Subversion revision with some status information. How can the tracker know with what user id to contact the Subversion server?
The rest of the proposal addresses UC1 and part of UC2 but not UC3. (UC3 looks like it needs some totally separate solution, outside of Subversion.)
A Subversion client (of any kind so designed) shall be able to read extended information about the author of a revision. This information shall consist of a (possibly empty) set of fields. The set of possible extended author fields shallinclude at least:
* authenticated user id
* display name
It shall be possible to add other fields on the server side (by software upgrade and/or by configuration), and for a client (of any kind so designed) to discover and read these fields without any software upgrade on the client side.
A client shall access the extended author fields through the Subversion server, through the existing client-server protocols, possibly with protocol extensions. Any protocol extensions shall be backward compatible in that an old server with a new client or an old client with a new server shall (without user intervention) use the old 'svn:author' property.
The fields that are available from a particular server or repository are determined by the administrator. For any particular committed revision, the server may provide any or all or none of the extended author fields. A client cannot rely on any particular field being available except to the extent that the administrator gives such an assurance. Example: if the client requests the authenticated user id and email address for a revision whose author has no email address recorded,the server shall provide the authenticated user id but no email address. If the server is temporarily unable to look up any information about a user, the server should respond with no extended author fieldsinstead of waiting.
The extended author fields are dynamic in the sense that the server need not always return the same values for the same committed revision. For example,a client might repeat exactly the same request for information about revision 1234 twice in quick succession, and the server might provide the email address as "a_at_b.c" the first time and "dd_at_ee.ff" the second time. Even the "authenticated user id" field could change.
The extended author fields are delivered through revision properties. The values are UTF-8 text. These revision properties are readable but not writable by clients.
Three property names are initially designated as "well known":
* prop name: "svn:author:authn-id"
* prop name: "svn:author:display-name"
* prop name: "svn:author:email"
Other property names in this name space beginning with "svn:author:" can be designated as "well known" in the future, by an official announcement from the Subversion project.
An administrator can configure other extended author fields to use property names that are not in the "svn:" name space. Example: an administrator could configure the property name "author:pgp-sig" to hold the author's PGP signature.
If the client attempts to set any revision property in the "svn:author:" name space, the server shall report an error to the client. This applies even if the property value matches the value that was last read from the server or is currently known to the server, and even if the
The extended author fields [are | are not] available to the following hook scripts: pre-commit, ...
Just an example. The "svn log" and "svn blame" commands could request the revision property named "svn:author:display-name", and if that is returned then use it instead of "svn:author", otherwise use the value of "svn:author". Further, a client-side configuration option could specify which property name should be used for these display purposes, so for example some users in a particular team could choose to have the "author:nickname" revision property displayed instead of "svn:author:display-name".
Does a client need to be able to look up the information in other ways, such as starting from svn:author rather than a revision number, or starting from an extended author field?
This is an archived mail posted to the Subversion Dev mailing list.