threads / discuss / 24449

Can I enforce required approval on some files

Subject: Can I enforce required approval on some files

## tl;dr

6 messages between Jul 20, 2010 and Jul 21, 2010.

replies: 5people: 5as markdown or json

Dominik Gront· Jul 20, 2010, 20:22 UTC · lore
Dear Group,

I have been a happy SVN user for quite a long time, but now I miss some functionality in Subversion. I wonder if it could be done in git. If so, I convert to git right away :-)

There are some files in our repository that all their modification
need to be approved by a project leader.  In general the desired
behavior would be (examples given in svn commands) :
- user runs "svn ci"
- some files have status "pending" or "waiting for approval"
- anyone can do "svn up", modifications to the pending files are not
retrieved, project leader can get the modified versions
- project leader accepts the changes
- anyone running "svn ci" sees all the modifications

Best, Tim

Bruce Stephens· Jul 20, 2010, 20:45 UTC · re: Dominik Gront · lore

Re: Can I enforce required approval on some files

Dominik Gront <dgront@gmail.com> writes:
Show 6 quoted lines
> I have been a happy SVN user for quite a long time, but now I miss
> some functionality in Subversion. I wonder if it could be done in git.
> If so, I convert to git right away :-)
>
> There are some files in our repository that all their modification
> need to be approved by a project leader.

Either have the repository owned by someone who'll do whatever checking you want (which seems to be common at least amongst the public projects) or use hooks in a shared repository. Specifically the update hook.

The hook can do whatever checking you deem appropriate. At work we have it check the commit message for Signed-off-by names (in our context it really means Reviewed-by; we use sob because that's more convenient to add). The hook could look at which files are changed or whatever else you wanted. (Notice it gets called to update a ref, and that may involve more than one commit, so be sure to check all the relevant commits.)

[...]
Sylvain Rabot· Jul 20, 2010, 20:45 UTC · re: Dominik Gront · lore

Re: Can I enforce required approval on some files

On Tue, 2010-07-20 at 13:22 -0700, Dominik Gront wrote:
Show 18 quoted lines
> Dear Group,
> 
> I have been a happy SVN user for quite a long time, but now I miss
> some functionality in Subversion. I wonder if it could be done in git.
> If so, I convert to git right away :-)
> 
> There are some files in our repository that all their modification
> need to be approved by a project leader.  In general the desired
> behavior would be (examples given in svn commands) :
> - user runs "svn ci"
> - some files have status "pending" or "waiting for approval"
> - anyone can do "svn up", modifications to the pending files are not
> retrieved, project leader can get the modified versions
> - project leader accepts the changes
> - anyone running "svn ci" sees all the modifications
> 
> Best,
> Tim
Hi,

Git itself does not allow what you want but the workflow used to work with git does.

Each developer work and on a "copy" of the "blessed" repository (the one checked out in svn, cloned in git) so it does not matter if modifications done to a file need approval or not. Once the developer is happy with his work he has to send his commit(s) to the person(s) in charge of maintaining the project and this/those people will review the changes and push (commit in svn language) them to the "blessed" repository if they are ok with the changes made.

With git, if not used like svn, all modifications need approval.

You can read more about git's distributed workflow here : http://progit.org/book/ch5-1.html

Regards.
-- 
Sylvain Rabot <sylvain@abstraction.fr>
Jakub Narebski· Jul 20, 2010, 22:03 UTC · re: Dominik Gront · lore

Re: Can I enforce required approval on some files

Dominik Gront <dgront@gmail.com> writes:
Show 13 quoted lines
> I have been a happy SVN user for quite a long time, but now I miss
> some functionality in Subversion. I wonder if it could be done in git.
> If so, I convert to git right away :-)
> 
> There are some files in our repository that all their modification
> need to be approved by a project leader.  In general the desired
> behavior would be (examples given in svn commands) :
> - user runs "svn ci"
> - some files have status "pending" or "waiting for approval"
> - anyone can do "svn up", modifications to the pending files are not
>   retrieved, project leader can get the modified versions
> - project leader accepts the changes
> - anyone running "svn ci" sees all the modifications

Besides solution mentioned by others, namely integration repository with moderator, you can also use patch/commit code review tool such as Gerrit (http://code.google.com/p/gerrit/), equivalent of Rietveld for Subversion, or Mondrian for Perforce.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Ævar Arnfjörð Bjarmason· Jul 21, 2010, 00:42 UTC · re: Jakub Narebski · lore

Re: Can I enforce required approval on some files

On Tue, Jul 20, 2010 at 22:03, Jakub Narebski <jnareb@gmail.com> wrote:
> Besides solution mentioned by others, namely integration repository
> with moderator, you can also use patch/commit code review tool such as
> Gerrit (http://code.google.com/p/gerrit/), equivalent of Rietveld for
> Subversion, or Mondrian for Perforce.

There's also the low-tech solution of just telling people to submit again until their patches don't suck, it works for git.git, and is attainable when you're not doing a centralized tool.

Jakub Narebski· Jul 21, 2010, 07:51 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: Can I enforce required approval on some files

On Wed, 21 Jul 2010, Ævar Arnfjörð Bjarmason wrote:
Show 10 quoted lines
> On Tue, Jul 20, 2010 at 22:03, Jakub Narebski <jnareb@gmail.com> wrote:
> 
> > Besides solution mentioned by others, namely integration repository
> > with moderator, you can also use patch/commit code review tool such as
> > Gerrit (http://code.google.com/p/gerrit/), equivalent of Rietveld for
> > Subversion, or Mondrian for Perforce.
> 
> There's also the low-tech solution of just telling people to submit
> again until their patches don't suck, it works for git.git, and is
> attainable when you're not doing a centralized tool.

That's what I meant by "besides [...] integration repository with moderator", moderator who reviews patches or pull requests, and accepts into integration repository or rejects them.

-- 
Jakub Narebski
Poland

← back to recent threads