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

Re: svn commit: r8576 - trunk/subversion/svnadmin

From: Juanma Barranquero <lektu_at_mi.madritel.es>
Date: 2004-02-08 03:34:37 CET

On 07 Feb 2004 19:37:31 -0600, "C. Michael Pilato" <cmpilato@collab.net> wrote:

> The "problem" is simply that post-revprop-change
> hooks might not always get a username. This could happen for
> different reasons, such as an open-auth repos, or an 'svnadmin
> setlog'.

Leaving aside the (subjective) ugliness of having an optional in-between
parameter (1st, 2nd and 4th are always present) instead of last, I feel
uncomfortable on the current status, for the reasons stated below.

> So hook writers need to be made aware of the fact that this
> could happen. If anything, this is just a little fix that needs to
> happen to the repos code that writes out the hook templates at repos
> creation time, just to note that sometimes there is an empty author.

In the following cases, it's always assumed that the p-r-c
(pre-revprop-change) hook must exist because it does something useful
and non-trivial (sending a mail, logging changes, reformatting the
non-revision property, whatever). Obviously, if no p-r-c hook is deemed
necessary, --bypass-hooks is the answer and the issue is settled.

 1) Protected repo, only the admin sets nvp (non-versioned props):
    - A p-r-c hook that only returns success on empty user. OK.

 2) Protected repo, users and admin set nvp:
    - If everyone can change to their hearts' content, just a p-r-c hook
      that always returns success. OK.
    - If not, a p-r-c hook that checks for valid users or empty (the
      admin). OK.

 3) Open repo, (all) users and admin set nvp:
    - p-r-c hook that always returns success. OK.

 4) Open repo, only the admin sets nvp:
    - ?

AFAICS (and I could very well be wrong), in the fourth case there's no
way to distinguish between the admin and the (anonymous) users, so
there's no way to set it up. The best you can do is reduce it to the
third case (open nvp changes for all) and record *every* nvp change, in
case some user goes mental and decides to wipe out all logs; or not
have a p-r-c hook, and force the admin to set nvp through a script
(remember, we're assuming there's additional work to be done on nvp
changes) that executes "svnadmin setlog --bypass-hooks". Ugly.

Funny thing is, I don't think the fourth case is that unusual, because
in an open repository, most users' changes are not harmful (they can
always be reverted), *except* changes to non-versioned props, so it
seems very sensible to limit those to the admin, even when other changes
(commits) are full open to the general public.

Summing up: the only real (if not earth-shaking, I agree) problem is
lacking a way to differentiate anonymous users from the admin. A simple
answer, like passing '*' instead of '' for anonymous users, would be
more than enough.


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Feb 8 03:34:52 2004

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

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