From 50082f1206c9c61b0ceafe6b71e7e28b9beeea30 Mon Sep 17 00:00:00 2001
From: tri <tri@thac.loan>
Date: Tue, 30 Sep 2025 08:23:39 +0700
Subject: [PATCH] add git hook instruction

---
 README.md | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index b0fe316..b5975a5 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,16 @@ Please **make sure there's nothing sensitive in your repos dir** before exposing
 
 You can now either serve the dir as-is using caddy/nginx/etc., or rsync it to a remote server, or serve it on s3 if you like burning your (employer's) money, or even, get this, make it a git repo itself to host on GitHub Pages for free! I'm not saying you should, but you could. Static web hosting is cheap, often free even. The world's your oyster.
 
+## Use as git hook
+
+Simplest way is to setup a global post-update hook like this:
+
+```sh
+flock /tmp/khoe khoe .. https://your.site
+```
+
+Using [flock][4] ensures that only 1 instance of the script could be running at a time, avoiding race conditions when multiple people could be pushing.
+
 ## Quirks
 
 Nothing is cached. Every page is regenerated every time. Computers are fast though so performance hasn't been a problem for me. If it is for you, let me know and we can optimize it.
@@ -56,8 +66,7 @@ Outdated pages, if not overwritten, are left as-is. Since git itself is an appen
 
 ## Contribute
 
-See <https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/git-no-forge/#preferences>.  
-I generally agree with his preferences.
+See [How to interact with a bare git repo][5]. I generally agree with his preferences.
 
 ## License
 
@@ -73,3 +82,5 @@ You should have received a copy of the GNU Affero General Public License along w
 [1]: https://codemadness.org/stagit.html
 [2]: https://mitchellh.com/writing/libghostty-is-coming
 [3]: https://github.com/theZiz/aha
+[4]: https://manpages.debian.org/trixie/util-linux/flock.1.en.html
+[5]: https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/git-no-forge/#submissions
-- 
2.47.3

