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

Re: Change "Author" name in SVN log

From: David Weintraub <qazwart_at_gmail.com>
Date: Mon, 20 Jul 2009 18:40:06 -0400

How does the user log in? Does the user login with the e032408 ID?

Subversion uses whatever the current login is in Windows or Unix, or
what the user provides when you give it the --username string.

You can modify svn:author revision property, but only once the
transaction has been committed, and you must have a pre-revprop-change
hook in place. The hook doesn't have to do anything, but if you don't
have one, you cannot change revision properties. The actual command is
like this:

     $ svn propset --revprop -r$REV svn:author $author

Getting into very iffy territory: You could create a post-commit hook
that looks up the old value of svn:author, and sets the new svn:author
to the more user friendly value. You'll have to also create a
pre-revprop-change hook that returns an exit value of zero in order
for the command to work.

I personally would be extremely hesitant to do such a setup. However,
if I had to do this, what I'd do is have a pre-revprop-change hook
that verifies that the svn:author is the weird login you currently
have. Otherwise, I wouldn't allow the property to be changed. That
way, a normal user cannot change this property after it has been set.

The post-commit hook would have a lookup table going from the weird
login to the more user friendly author. Once the substitute author
name is found, I'd simply run the "svn propset --revprop" command.

You can find out more information at
<http://svnbook.red-bean.com/en/1.5/svn.ref.reposhooks.post-commit.html>
and <http://svnbook.red-bean.com/en/1.5/svn.ref.reposhooks.pre-revprop-change.html>.

Make sure this is something you really, really want to do, and there's
no way to change your login setup to have user friendly logins. If you
do decide to go through with this, good luck.

On Mon, Jul 20, 2009 at 4:58 PM, mercuryman<mercuryman01_at_gmail.com> wrote:
> I have setup SVN server with Apache 2 that serves multiple repositories and
> LDAP as authentication agent. Its up and running well. The user ID in LDAP
> database is an alpha-numeric ID like e032408. As this user ID is associated
> with svn commit & svn log output shows this ID as "Author". This maks it
> difficult to know who did the commit. Is there a way to replace/change this
> ID & have SVN read user's "CN" from LDAP database & add it to svn log? Any
> help is greatly appriciated. Here is my conf file.
>
> # Load Subversion Apache Modules
> LoadModule dav_svn_module modules/mod_dav_svn.so
> LoadModule authz_svn_module modules/mod_authz_svn.so
>
> CustomLog logs/svn_logfile "%t %u %{SVN-ACTION}e" env=SVN-ACTION
>
> <Location />
> AuthType Basic
> AuthBasicProvider ldap
> AuthzLDAPAuthoritative off
> AuthName "Subversion repository"
> AuthLDAPURL
> "ldap://ldap.server.com/dc=server,dc=com?uid?sub?(objectClass=*)"
> AuthLDAPBindDN
> uid=svcSubversion,ou=ServiceAccounts,ou=Users,dc=server,dc=com
> AuthLDAPBindPassword password
>
> Require valid-user
> </Location>
>
> <Location /svn>
> DAV svn
> SVNParentPath /mnt/scm/subversion
> SVNListParentPath On
> SVNReposName "Subversion repository"
>
> AuthzSVNAccessFile /etc/httpd/conf.d/access_file
>
> Satisfy Any
> Authname "Subversion repositry"
> </Location>
> --
> View this message in context: http://www.nabble.com/Change-%22Author%22-name-in-SVN-log-tp24542566p24542566.html
> Sent from the Subversion Users mailing list archive at Nabble.com.
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2372726
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
>

-- 
David Weintraub
qazwart_at_gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2372753
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-07-21 00:41:18 CEST

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

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