On Fri, Apr 5, 2013 at 7:32 AM, Giovanni Gargiulo
<
gargiul...@gmail.com> wrote:
> I'm trying to introduce Gerrit in my team. At the moment we already have a
> git repo that is used in a jenkins pipeline.
>
> Now, I've been able to clone the git repo inside Gerrit cloning it as a
> "mirror" in the ${gerrit_home}/git/ folder.
>
> Everything works fine, I can clone from Gerrit, push to it, run jenkins to
> validate and review code with my colleagues. When a changeset is verifyied
> and merged, thou, it does not get push to the main repo.
>
> As a workaround I used the (plugin) replication to push reviewed changes to
> the main repo (the main original one connected to the jenkins pipeline). Is
> the replication the only one solution?
Unfortunately yes. Gerrit was built under the assumption that it is
the gatekeeper of _the_ central repository. Replication exists to send
copies to other systems after-the-fact for backup purposes, or
automated builds after submit, etc.
I understand the use case of wanting to have Gerrit play nice with an
existing central repository and take advantage of the distributed
nature of Git, but unfortunately Gerrit was not built with this in
mind, so it doesn't do it. In theory it could be fixed in Gerrit, but
its some effort to have Gerrit perform all writes to a remote
repository, and continuously poll the remote to make sure its local
one is up-to-date before accepting a push to a branch, or submitting a
change.