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

RE: stalling commits until approval

From: Bob Archer <Bob.Archer_at_amsi.com>
Date: Tue, 26 Jan 2010 17:58:11 -0500

> > I thought I had made a suggestion on how you could create an approval
> process... perhaps you didn't see the email.
>
> I must have missed it. I did try a search through my archive, prior
> to sending out this e-mail. Even looked for anything I sent to the
> old list that had replies.

Basically, my suggestion was to have a pre-commit hook that rejects any of these approval required files unless an approval code was submitted in the commit message. If there is not a valid approval code the script would generate a code and store it in a file on the local server. It would email that code with the commit attached to the approval manager/person. The approval person would look at it... and if it looked ok they could forward the approval code back to the dev that made the change. The dev would repeat the commit including the approval code in the commit message. This time, the pre-commit hook would see the approval message, verify it against the stored code it generated, delete the cached approval code and allow the commit.

So, the flow would be something like... (psuedo code)

IF FileThatRequiresApprovalIsInChangeSet
  IF ApprovalCodeIsInCommitMessage
    IF CheckForMatchingCachedApprovalCodeForThatFile
      DeleteApprovalCodeCacheFile
      return true
    ELSE
      put "Invalid approval code" to STDERR
      return false (reject commit)
    END
  ELSE
    Generate Approval Code
    Create Approval Code Cache File
    Email approver with file attached
    put "Commit requires approval" to STDERR
    return false (reject commit)
  END
ELSE
  return true
END

Hope that helps.

BOb
Received on 2010-01-26 23:58:18 CET

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.