git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Joydeep Bakshi <joydeep.bakshi@infoservices.in>
Cc: "Magnus Bäck" <baeck@google.com>,
	"Fredrik Gustafsson" <iveqy@iveqy.com>,
	git@vger.kernel.org
Subject: Re: building git ; need suggestion
Date: Mon, 18 Mar 2013 19:11:50 -0700	[thread overview]
Message-ID: <CAJDDKr6bmH6gDSBPN+U6LbSNrFw-adsfv0ZESDAOG7H2nuZapg@mail.gmail.com> (raw)
In-Reply-To: <9E0367AC-617A-440B-925E-5796CF2E1ADF@infoservices.in>

On Mon, Mar 18, 2013 at 5:24 AM, Joydeep Bakshi
<joydeep.bakshi@infoservices.in> wrote:
> 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

You should try gitolite.  It has very flexible rules,
and it's already been implemented for you ;-)

https://github.com/sitaramc/gitolite



> ===========================
> #!/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 <joydeep.bakshi@infoservices.in> wrote:
>
>>
>> On 15-Mar-2013, at 6:44 PM, Magnus Bäck <baeck@google.com> 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 majordomo@vger.kernel.org
>> 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
David

  reply	other threads:[~2013-03-19  2:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15 12:24 building git ; need suggestion Joydeep Bakshi
2013-03-15 12:43 ` Joydeep Bakshi
2013-03-15 12:44 ` Fredrik Gustafsson
2013-03-15 12:52   ` Joydeep Bakshi
2013-03-15 13:14     ` Magnus Bäck
2013-03-18  5:44       ` Joydeep Bakshi
2013-03-18 12:24         ` Joydeep Bakshi
2013-03-19  2:11           ` David Aguilar [this message]
2013-03-15 17:25     ` Paul Campbell
2013-03-15 13:56   ` Konstantin Khomoutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJDDKr6bmH6gDSBPN+U6LbSNrFw-adsfv0ZESDAOG7H2nuZapg@mail.gmail.com \
    --to=davvid@gmail.com \
    --cc=baeck@google.com \
    --cc=git@vger.kernel.org \
    --cc=iveqy@iveqy.com \
    --cc=joydeep.bakshi@infoservices.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).