* git-smart-http reject push
@ 2012-05-31 20:38 Tajti Ákos
2012-05-31 20:52 ` Shawn Pearce
2012-06-01 3:53 ` Sitaram Chamarty
0 siblings, 2 replies; 4+ messages in thread
From: Tajti Ákos @ 2012-05-31 20:38 UTC (permalink / raw)
To: git@vger.kernel.org
Dear List,
we wrote a servlet that is basically a proxy for git-http-backend. We
want to control who can create a new branch. Is there a way to reject a
push that would create a new branch (without using hooks)?
Thanks in advance,
Ákos Tajti
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git-smart-http reject push
2012-05-31 20:38 git-smart-http reject push Tajti Ákos
@ 2012-05-31 20:52 ` Shawn Pearce
2012-06-01 3:53 ` Sitaram Chamarty
1 sibling, 0 replies; 4+ messages in thread
From: Shawn Pearce @ 2012-05-31 20:52 UTC (permalink / raw)
To: Tajti Ákos; +Cc: git@vger.kernel.org
On Thu, May 31, 2012 at 1:38 PM, Tajti Ákos <akos.tajti@intland.com> wrote:
> we wrote a servlet that is basically a proxy for git-http-backend. We want
> to control who can create a new branch. Is there a way to reject a push that
> would create a new branch (without using hooks)?
Not easily. Is the servlet in Java? You might want to consider just
embedding JGit[1] and using that. JGit will let your servlet install
an implementation of its PreReceiveHook interface where you can
inspect the parsed protocol data, decide what to do, and reject it or
allow it through.
To reject before it makes it to git-http-backend you need to parse the
incoming data stream, decode the commands, and then forward the
unparsed stream to git-http-backend. If you are in Java you might be
able to reuse some of the JGit classes to help you parse the protocol.
Maybe. Those classes weren't really built to be used on their own.
[1] http://www.eclipse.org/jgit/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git-smart-http reject push
2012-05-31 20:38 git-smart-http reject push Tajti Ákos
2012-05-31 20:52 ` Shawn Pearce
@ 2012-06-01 3:53 ` Sitaram Chamarty
2012-06-01 6:52 ` Tajti Ákos
1 sibling, 1 reply; 4+ messages in thread
From: Sitaram Chamarty @ 2012-06-01 3:53 UTC (permalink / raw)
To: Tajti Ákos; +Cc: git@vger.kernel.org
On Fri, Jun 1, 2012 at 2:08 AM, Tajti Ákos <akos.tajti@intland.com> wrote:
> Dear List,
>
> we wrote a servlet that is basically a proxy for git-http-backend. We want
> to control who can create a new branch. Is there a way to reject a push that
> would create a new branch (without using hooks)?
Not sure what else your servlet does or how it affects things but
gitolite has controls to prevent branches being created (among many
many other things, limited mostly by ones imagination!).
Gitolite is normally used with ssh but it has been tested with smart
http also. It itself acts as a proxy for git-http-backend, inspecting
the URI and QUERY_STRING and such animals to decode some things, while
the rest happens via a special update hook that is installed in each
repo that it controls.
(Specifically, the branch create check is done there, not in the part
that is proxying the git-http-backend process. You probably know that
the update hook is invoked by git itself).
Sitaram
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git-smart-http reject push
2012-06-01 3:53 ` Sitaram Chamarty
@ 2012-06-01 6:52 ` Tajti Ákos
0 siblings, 0 replies; 4+ messages in thread
From: Tajti Ákos @ 2012-06-01 6:52 UTC (permalink / raw)
Cc: git@vger.kernel.org
Thanks for the answers!
Ákos
2012.06.01. 5:53 keltezéssel, Sitaram Chamarty írta:
> On Fri, Jun 1, 2012 at 2:08 AM, Tajti Ákos<akos.tajti@intland.com> wrote:
>> Dear List,
>>
>> we wrote a servlet that is basically a proxy for git-http-backend. We want
>> to control who can create a new branch. Is there a way to reject a push that
>> would create a new branch (without using hooks)?
> Not sure what else your servlet does or how it affects things but
> gitolite has controls to prevent branches being created (among many
> many other things, limited mostly by ones imagination!).
>
> Gitolite is normally used with ssh but it has been tested with smart
> http also. It itself acts as a proxy for git-http-backend, inspecting
> the URI and QUERY_STRING and such animals to decode some things, while
> the rest happens via a special update hook that is installed in each
> repo that it controls.
>
> (Specifically, the branch create check is done there, not in the part
> that is proxying the git-http-backend process. You probably know that
> the update hook is invoked by git itself).
>
> Sitaram
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-01 6:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 20:38 git-smart-http reject push Tajti Ákos
2012-05-31 20:52 ` Shawn Pearce
2012-06-01 3:53 ` Sitaram Chamarty
2012-06-01 6:52 ` Tajti Ákos
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).