feat: New command repo state

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb
2025-08-13 16:33:15 +00:00
parent 9aa3b62de0
commit dd05e050cd
7 changed files with 209 additions and 5 deletions

29
docs/repo/state.md Normal file
View File

@@ -0,0 +1,29 @@
# Repository State Announcements
> `n34 repo state` command
**Usage:**
```
Repository state announcements
Usage: n34 repo state [OPTIONS] <HEAD>
Arguments:
<HEAD> Name of the repository's primary branch, such as 'master' or 'main'
Options:
--repo <NADDR-NIP05-OR-SET> Repository address in `naddr` format (`naddr1...`), NIP-05 format (`4rs.nl/n34` or `_@4rs.nl/n34`), or a set name like `kernel`
--tags <TAGS> Tags to announce a state for, in the format `<tag-name>=<commit-id>`. Separated by comma
--branches <BRANCHES> Branches to announce a state for, in the format `<branch-name>=<commit-id>`. Separated by comma
```
This command allows you to announce your repository state, which is useful for
pushing to permissionless git repositories like the [GRASP] relay. The relay
will verify your repository state and permit pushing commits only if they match
the announced state.
To get the commit ID that a branch or tag points to, use `git rev-parse
<tag-or-branch-name>`. You can automate this process by creating a script to
generate the required input for this command.
[GRASP]: https://ngit.dev/grasp