Change svn username during commit
We have corporate logins like QWE098765 and how to use them to access the SVN repository. I want to display these names in emails so they will be available to people in SVN history.
I am currently using a post-commit hook that changes the svn: author revision property, but ... But here is a small gap between the commit and the change name, and sometimes SVN change tracking applications (CommitMonitor, Jenkins) catch the name QWE098765 instead of electronic letters. It's not a big problem, but annoying.
Maybe there is another way to display names here?
PS We are using VisualSVN server to access the repository.
source to share
Finally I got it from Lazy Badger
Indeed, this is not possible with standard tools: http://svn.haxx.se/users/archive-2014-09/0032.shtml
But you can write a simple script or program and work directly with the Subversion API. I'm writing a simple implementation of a program like this: https://github.com/azarkevich/SvnPreCommitAuthor
The file path is required with the mapping name -> new name and must be run as a pre-commit hook.
source to share
Use a python script to change author in a pre-commit hook:
This is a good example: http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/log-police.py This changes the log, but changing the author works the same (just replace svn: log with svn : author).
You will need python-subversion. If you are on Ubuntu / Debian install it using:
sudo apt install python-subversion
source to share