[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: Matt Joiner <anacrolix_at_gmail.com>
Date: Wed, 5 Oct 2011 19:52:02 +1100

I tried this, but an author is not passed unless auth-access is in use
AFAICT. So $USER in your example is always empty.

On Wed, Oct 5, 2011 at 7:16 PM, Dominik Psenner <dpsenner_at_gmail.com> wrote:
>>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:52:55 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.