I'm closer to my requirement. I have found gitweb simply provide a GUI for
history check
and code comparison. And the git itself is good enough to do the ACL stuff with
hooks.
I already have the following code to deploy the push into its work-tree
===========================
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
git --work-tree=/path/under/root/dir/live-site/ checkout -f $branch
echo 'Changes pushed live.'
fi
if [ "dev" == "$branch" ]; then
git --work-tree=/path/under/root/dir/dev-site/ checkout -f $branch
echo 'Changes pushed to dev.'
fi
done
=========================
This code can be extended for as many branches as you have.
I now need a mechanism to restrict the user to it's own branch so that user
can't push into
any other branch in mistake.
Say I have
master branch -> only admin user can push here.
dev branch -> only user dev1 , dev2 and master can push here.
testing branch -> only user test1 and test2 can push here.
I think this can also be done with pre-receive hook. Any suggestion on the hook
design is
welcome. Also this can be implemented on the above hook or in a separate hook.
A separate hook is better due to maintainability and then I need to call
multiple
pre-receive hook. Please suggest.
Thanks
On 18-Mar-2013, at 11:14 AM, Joydeep Bakshi <[email protected]>
wrote:
>
> On 15-Mar-2013, at 6:44 PM, Magnus Bäck <[email protected]> wrote:
>>>
>>
>> Right, but that's R/W permissions. Almost any piece of Git hosting
>> software supports restriction of pushes. Discriminating *read* access
>> between developers and maintenance people sounds like a disaster if it's
>> the same organisation.
>
> Just restriction on push access is what required.
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html