summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-12-29 01:57:01 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-12-29 01:57:01 (GMT)
commit91e000f8815263418dab8069a5f3b621ff617aaf (patch)
tree8892a3f119cc733e65e59ef0992846af10110766
parent903f4ca05354daa572ae4aa964359899d6d911eb (diff)
downloadmisc-91e000f8815263418dab8069a5f3b621ff617aaf.zip
misc-91e000f8815263418dab8069a5f3b621ff617aaf.tar.gz
misc-91e000f8815263418dab8069a5f3b621ff617aaf.tar.bz2
censorgit/README: usage instructions
-rw-r--r--censorgit/README81
1 files changed, 81 insertions, 0 deletions
diff --git a/censorgit/README b/censorgit/README
new file mode 100644
index 0000000..accb3d6
--- /dev/null
+++ b/censorgit/README
@@ -0,0 +1,81 @@
+Local testing
+-------------
+
+# prepare two clones of ee-full: ee-full.git is the "server" repo.
+# ee-full is our local working copy, where we can make changes that
+# then propagate to the public repo.
+
+# Change this path according to local setup
+cd /home/n9/misc/censorgit
+mkdir t
+cd t
+git clone --bare ssh://git@neo900.org:.../ee-full.git
+git clone ssh://localhost/home/n9/misc/censorgit/t/ee-full.git
+
+# place the hook
+
+ln -s ../../../post-receive ee-full.git/hooks/
+
+# make "cg" available
+# (note: our "t" is "repositories", so we need to go one level up)
+
+mkdir ../bin
+ln -s ../cg ../bin/
+
+# prepare the redacted public repo, and the "feeder".
+# we need the feeder since "git am" doesn't work on bare repos.
+
+rm -rf ee.git ee
+git init --bare ee.git
+git clone ee.git ee-feeder
+
+# populate the public repo (through the feeder) from ee-full
+
+SRC=`pwd`/ee-full.git
+DST=`pwd`/ee-feeder
+../cg-neo900 --bare "$SRC" "$DST"
+(cd ee-feeder && git push -u origin master)
+
+# make some change and push it
+
+cd ee-full
+echo blah >>README
+git commit -m foo .
+git push
+
+# check that it made it to the public repo
+
+cd ../ee.git
+git show
+
+
+Server setup
+------------
+
+git clone https://neo900.org/git/misc/
+sudo -u git cp misc/censorgit/cg{,-neo900} ~git/bin/
+sudo -u git cp misc/censorgit/post-receive ~git/repositories/ee-full.git/hooks/
+sudo -iu git cd repositories; git clone ee.git ee-feeder
+
+
+Manually apply an incremental update
+------------------------------------
+
+sudo -iu git
+cd repositories/ee-full.git
+echo oldref newref refs/heads/master | hooks/post-receive
+
+
+Create ee.git from scratch
+--------------------------
+
+# This is similar to the local test, above
+
+sudo -iu git
+cd repositories
+rm -rf ee.git ee-feeder
+git init --bare ee.git
+echo Electronics Engineering >ee.git/description
+git clone ee.git ee-feeder
+../bin/cg-neo900 ee-full.git ee-feeder
+(cd ee-feeder && git push -u origin master)