On 10/03/16 09:26, Sitaram Chamarty wrote:
> I'm sorry but I've already said that is not the goal of partial-copy.
> I think what this use case, as well as what Tony (in a different thread)
> was talking about, should both be separated from partial-copy, and be
> called something else, like maybe "publish" or perhaps
> "partial-publish".
>
> I'll write a longer email about this soon-ish.
(nomenclature: "PCR" - partial copy repo, "MAIN" - the main repo)
1. rationale for partial-copy
First, the rationale for the partial-copy feature was that certain
developers needed to be able to work on a repo but some of the
branches should not be visible to them.
This means pushes *will* happen on PCR, which need to be propagated
to MAIN immediately. Treating the PCR as merely a transit point
keeps things sane and simple:
* right before you access a PCR, it gets stuff from MAIN
* right after you push to a PCR, it pushes that stuff to MAIN
(The code can even take care of situations where someone pushes
to MAIN and someone else pushes to PCR, and these two clash!)
This becomes especially important if you need multiple PCRs. I seem
to recall one user who needed 3 off of one MAIN, due to different
jurisdictions or some such legal nonsense.
2. partial-copy with mirroring
Based on the above, the only logical way is for MAIN to be mirrored
to all slaves as soon as the "PCR -> MAIN" happens on the master
server. So that is what we will be doing (the code has not yet been
pushed; I expect to do this by this weekend or so).
In fact there is no need for the PCRs to be mirrored at all. If
they are, the mirroring will happen, but will effectively be a waste
- the next time someone fetches or clones from the slave, it will
get a fresh update from its MAIN anyway.
3. "publishing" a repo
The need to have a public copy that needs to be accessed from
outside gitolite (like say gitweb for instance), is quite different.
In this case, we will have to assume/expect that no one will be
developing on those copies, so we don't have to worry about keeping
things in sync in both directions. A push happens to the main and
it will generate a push to the copy.
For this, the code that Tony linked to in his email [1][2] -- let's
call it "partial-publish" for the sake of clarity -- is fine, but I
suggest that the "-" rules be in the copy's ruleset, not in the main
repo's ruleset. This lets you have multiple "public" repos, with
different restrictions, if needed, without cluttering up the access
list for the main repo.
4. mirroring a "published" repo
I am pretty sure "partial-publish" can have a few more lines added
along the lines of:
unset GL_USER
for m in `gitolite mirror list slaves $repo`; do
gitolite mirror push $m $main
done
hope this helps
regards
sitaram
[1]:
https://groups.google.com/d/msg/gitolite/019OTccFwmw/cCMfVAvvEQAJ
[2]:
http://article.gmane.org/gmane.comp.version-control.gitolite/4246