Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

partial-copy would not propagate deletes; fixed

  • Loading branch information...
commit 53543ee3e6a837dc3ecca3c990f7ab6bd7ee933b 1 parent fb9829a
@sitaramc authored
Showing with 21 additions and 6 deletions.
  1. +12 −6 doc/non-core.mkd
  2. +9 −0 src/VREF/partial-copy
View
18 doc/non-core.mkd
@@ -127,22 +127,28 @@ Here's how:
repo foo-partialcopy-1
- secret-branch = @temp-emp
- # other rules should ensure ONLY @temp-emp has ANY ACCESS
- # NO other user should have access
+
+ # other rules; see notes below
- VREF/partial-copy = @all
config gitolite.partialCopyOf = foo
- **IMPORTANT**: if you're using other VREFs, please make sure this one is
- placed at the end, after all the others.
+ **IMPORTANT NOTES**:
+
+ * if you're using other VREFs, **make sure** this one is placed at the
+ end, after all the others.
+
+ * remember that any change allowed to be made to the partial-copy repo
+ will propagate to the main repo so make sure you use other rules to
+ restrict pushes to other branches and tags as needed.
And that should be it. **Please test it and let me know if it doesn't work!**
WARNINGS:
* If you change the config to disallow something that used to be allowed,
- you should delete the partial repo on the server and then run 'gitolite
- compile' to let it build again. See t/partial-copy.t for details.
+ you should delete the partial repo on the server and then run `gitolite
+ compile; gitolite trigger POST_COMPILE` to let it build again.
* Not tested with smart http; probably won't work.
View
9 src/VREF/partial-copy
@@ -23,6 +23,15 @@ main=`git config --file $GL_REPO_BASE/$repo.git/config --get gitolite.partialCop
rand=$$
export GL_BYPASS_ACCESS_CHECKS=1
+if [ "$new" = "0000000000000000000000000000000000000000" ]
+then
+ # special case for deleting a ref (this is why it is important to put this
+ # VREF as the last one; if we got this far he is allowed to delete it)
+ git push -f $GL_REPO_BASE/$main.git :$ref || die "FATAL: failed to delete $ref"
+
+ exit 0
+fi
+
git push -f $GL_REPO_BASE/$main.git $new:refs/partial/br-$rand || die "FATAL: failed to send $new"
cd $GL_REPO_BASE/$main.git
Please sign in to comment.
Something went wrong with that request. Please try again.