feat: support pull requests

Support for pull requests, it's not standard in NIPs yet[1] but there must be
two clients that support it to be included in NIPs, n34 is one of them.

This support:
- Create a new PR `n34 pr new`
- Update PR tip `n34 pr update`
- View a PR `n34 pr view`
- List PRs `n34 pr list`
- Add `PR` and `PR-update` kinds as roots in `NostrClient::find_root`
- Support issuing statuses for PRs
- Support GRASP PR and PR-update
- Update the docs

[1] https://github.com/nostr-protocol/nips/pull/1966
This commit is contained in:
Awiteb
2025-09-12 06:43:23 +00:00
parent cc3aed0e89
commit 4360aa192c
43 changed files with 1714 additions and 143 deletions

22
docs/pr/merge.md Normal file
View File

@@ -0,0 +1,22 @@
# Merge a Pull Request
> `n34 pr merge` command
**Usage:**
```
Usage: n34 pr merge [OPTIONS] <PR_ID> <MERGE_COMMIT>
Arguments:
<PR_ID> The open PR id to merge it
<MERGE_COMMIT> The merge commit id
Options:
--repo <NADDR-NIP05-OR-SET> Repository addresses
```
Creates a kind `1631` event (Applied/Merged status) for the specified PR. The
PR must be in open status.
You can get the `MERGE_COMMIT` commit using `git rev-parse HEAD` command if
the merge commit in the `HEAD` or use `HEAD~n` where the `n` is the number of
commits the merge commit before the HEAD