aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CLAUDE.md29
-rw-r--r--README.md17
2 files changed, 46 insertions, 0 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index 8e29936..81fda40 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -186,6 +186,35 @@ git commit -m'<package-name>: add version X.Y.Z'
---
+## Git Hooks
+
+Versioned source lives in `.extras/hooks/`. They are NOT auto-installed
+(git ignores `.git/hooks/` only if `core.hooksPath` is unset; the user's
+global `core.hooksPath` dispatches to `.git/hooks/<name>` when executable).
+After a fresh clone, install them:
+
+```bash
+cp .extras/hooks/* .git/hooks/ && chmod 0755 .git/hooks/{pre,post}-commit
+```
+
+- `pre-commit` — runs `sbolint` on each changed package; aborts the commit on
+ any error. Also auto-removes staged source-archive symlinks and blocks
+ staged regular source archives (`*.tar.*`, `*.zip`, `*.deb`, etc.). Skip
+ with `SBOLINT=no git commit ...`.
+- `post-commit` — for each added/updated `*.SlackBuild`, offers to build the
+ SBo submission tarball into `SBo/<package>.tar.gz`.
+
+### `SBO_ARCHIVE` (non-interactive archive answer)
+
+`post-commit` normally prompts on a TTY. To answer without one (agents,
+scripts), set `SBO_ARCHIVE`:
+
+- `SBO_ARCHIVE=yes git commit ...` — build the tarball, no prompt
+- `SBO_ARCHIVE=no git commit ...` — skip, no prompt
+- unset + TTY → interactive prompt; unset + no TTY → skip
+
+---
+
## Commit Conventions
- One commit per package add/update
diff --git a/README.md b/README.md
index 8811a65..27a658d 100644
--- a/README.md
+++ b/README.md
@@ -44,3 +44,20 @@ This list is ever growing, if you want to ask for a package to be prioritized, j
> The cadaver package is available on slackbuilds.org but it's for an older version. I've reported here the script and built the newest version. The slackbuild includes now a pull from the [notroj/neon](https://github.com/notroj/neon) repository which is usually not allowed for SlackBuilds that are uploaded to slackbuilds.org
>
> The Powershell package is available on slackbuilds.org without modifications necessary so I removed it.
+
+## Git Hooks
+
+This repo ships maintainer git hooks under `.extras/hooks/`. After cloning,
+install them with:
+
+```bash
+cp .extras/hooks/* .git/hooks/ && chmod 0755 .git/hooks/{pre,post}-commit
+```
+
+- **pre-commit** lints each changed package with `sbolint` and blocks the
+ commit on errors. It also refuses staged source archives (these are fetched
+ with `sbodl`, never committed). Bypass linting with `SBOLINT=no git commit`.
+- **post-commit** offers to build an SBo submission tarball
+ (`SBo/<package>.tar.gz`) for any added or updated package. To answer the
+ prompt non-interactively, set `SBO_ARCHIVE=yes` or `SBO_ARCHIVE=no` in the
+ environment.