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

RE: Transaction author without requiring password

From: Dominik Psenner <dpsenner_at_gmail.com>
Date: Wed, 5 Oct 2011 10:16:51 +0200

>I'm trying to force commits to have an attached author, but I don't
>care for requiring passwords. In other words, commits should contain
>an author field but there's no enforcing that the committer is who
>they claim to be.
>
>I've tried filtering for an author in the pre-commit hook, but the
>user name given in the commit is not passed unless anon-access doesn't
>given write privileges, and auth-access is enabled. Furthermore,
>without a corresponding author name in the passwd file, I don't think
>svnserve makes it to the pre-commit stage at all.
>
>Are there any recommended solutions for ensuring that commits have an
>attached author, or similar field?

Maybe something like this put in place as a pre-commit hook?

#!/bin/bash
SVNLOOK=/usr/bin/svnlook
REPOPATH=$1
TRANSACTION=$2

# get user
USER=`$SVNLOOK author $REPOPATH -t $TRANSACTION`

# check if the user is empty
if[ -z "$USER" ]; then
  exit 1
exit 0
Received on 2011-10-05 10:17:30 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.