upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/34.md
diff options
context:
space:
mode:
Diffstat (limited to '34.md')
-rw-r--r--34.md104
1 files changed, 95 insertions, 9 deletions
diff --git a/34.md b/34.md
index 651407d..35bc1be 100644
--- a/34.md
+++ b/34.md
@@ -17,41 +17,82 @@ Git repositories are hosted in Git-enabled servers, but their existence can be a
17 "kind": 30617, 17 "kind": 30617,
18 "content": "", 18 "content": "",
19 "tags": [ 19 "tags": [
20 ["d", "<repo-id>"], 20 ["d", "<repo-id>"], // usually kebab-case short name
21 ["name", "<human-readable project name>"], 21 ["name", "<human-readable project name>"],
22 ["description", "brief human-readable project description>"], 22 ["description", "brief human-readable project description>"],
23 ["web", "<url for browsing>", ...], // a webpage url, if the git server being used provides such a thing 23 ["web", "<url for browsing>", ...], // a webpage url, if the git server being used provides such a thing
24 ["clone", "<url for git-cloning>", ...], // a url to be given to `git clone` so anyone can clone it 24 ["clone", "<url for git-cloning>", ...], // a url to be given to `git clone` so anyone can clone it
25 ["relays", "<relay-url>", ...] // relays that this repository will monitor for patches and issues 25 ["relays", "<relay-url>", ...] // relays that this repository will monitor for patches and issues
26 ["r", "<earliest-unique-commit-id>", "euc"]
27 ["maintainers", "<other-recognized-maintainer>", ...]
26 ] 28 ]
27} 29}
28``` 30```
29 31
30The tags `web`, `clone`, `relays` can have multiple values. 32The tags `web`, `clone`, `relays`, `maintainers` can have multiple values.
33
34The `r` tag annotated with the `"euc"` marker should be the commit ID of the earliest unique commit of this repo, made to identify it among forks and group it with other repositories hosted elsewhere that may represent essentially the same project. In most cases it will be the root commit of a repository. In case of a permanent fork between two projects, then the first commit after the fork should be used.
31 35
32Except `d`, all tags are optional. 36Except `d`, all tags are optional.
33 37
38## Repository state announcements
39
40An optional source of truth for the state of branches and tags in a repository.
41
42```jsonc
43{
44 "kind": 30618,
45 "content": "",
46 "tags": [
47 ["d", "<repo-id>"], // matches the identifier in the coresponding repository announcement
48 ["refs/<heads|tags>/<branch-or-tag-name>","<commit-id>"]
49 ["HEAD", "ref: refs/heads/<branch-name>"]
50 ]
51}
52```
53
54The `refs` tag may appear multiple times, or none.
55
56If no `refs` tags are present, the author is no longer tracking repository state using this event. This approach enables the author to restart tracking state at a later time unlike [NIP-09](09.md) deletion requests.
57
58The `refs` tag can be optionally extended to enable clients to identify how many commits ahead a ref is:
59
60```jsonc
61{
62 "tags": [
63 ["refs/<heads|tags>/<branch-or-tag-name>", "<commit-id>", "<shorthand-parent-commit-id>", "<shorthand-grandparent>", ...],
64 ]
65}
66```
67
34## Patches 68## Patches
35 69
36Patches can be sent by anyone to any repository. Patches to a specific repository SHOULD be sent to the relays specified in that repository's announcement event's `"relays"` tag. Patch events SHOULD include an `a` tag pointing to that repository's announcement address. 70Patches can be sent by anyone to any repository. Patches to a specific repository SHOULD be sent to the relays specified in that repository's announcement event's `"relays"` tag. Patch events SHOULD include an `a` tag pointing to that repository's announcement address.
37 71
72Patches in a patch set SHOULD include a NIP-10 `e` `reply` tag pointing to the previous patch.
73
74The first patch revision in a patch revision SHOULD include a NIP-10 `e` `reply` to the original root patch.
75
38```jsonc 76```jsonc
39{ 77{
40 "kind": 1617, 78 "kind": 1617,
41 "content": "<patch>", // contents of <git format-patch> 79 "content": "<patch>", // contents of <git format-patch>
42 "tags": [ 80 "tags": [
43 ["a", "30617:<base-repo-owner-pubkey>:<base-repo-id>"], 81 ["a", "30617:<base-repo-owner-pubkey>:<base-repo-id>"],
82 ["r", "<earliest-unique-commit-id-of-repo>"] // so clients can subscribe to all patches sent to a local git repo
44 ["p", "<repository-owner>"], 83 ["p", "<repository-owner>"],
45 ["p", "<other-user>"], // optionally send the patch to another user to bring it to their attention 84 ["p", "<other-user>"], // optionally send the patch to another user to bring it to their attention
46 85
47 // for the first patch in a thread or series 86 ["t", "root"], // omitted for additional patches in a series
48 ["t", "root"], 87 // for the first patch in a revision
88 ["t", "root-revision"],
49 89
50 // optional tags for when it is desirable that the merged patch has a stable commit id 90 // optional tags for when it is desirable that the merged patch has a stable commit id
51 // these fields are necessary for ensuring that the commit resulting from applying a patch 91 // these fields are necessary for ensuring that the commit resulting from applying a patch
52 // has the same id as it had in the proposer's machine -- all these tags can be omitted 92 // has the same id as it had in the proposer's machine -- all these tags can be omitted
53 // if the maintainer doesn't care about these things 93 // if the maintainer doesn't care about these things
54 ["commit", "<current-commit-id>"], 94 ["commit", "<current-commit-id>"],
95 ["r", "<current-commit-id>"] // so clients can find existing patches for a specific commit
55 ["parent-commit", "<parent-commit-id>"], 96 ["parent-commit", "<parent-commit-id>"],
56 ["commit-pgp-sig", "-----BEGIN PGP SIGNATURE-----..."], // empty string for unsigned commit 97 ["commit-pgp-sig", "-----BEGIN PGP SIGNATURE-----..."], // empty string for unsigned commit
57 ["committer", "<name>", "<email>", "<timestamp>", "<timezone offset in minutes>"], 98 ["committer", "<name>", "<email>", "<timestamp>", "<timezone offset in minutes>"],
@@ -59,17 +100,24 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor
59} 100}
60``` 101```
61 102
103The first patch in a series MAY be a cover letter in the format produced by `git format-patch`.
104
62## Issues 105## Issues
63 106
64Issues are Markdown text that is just human-readable conversational threads related to the repository: bug reports, feature requests, questions or comments of any kind. Like patches, these SHOULD be sent to the relays specified in that repository's announcement event's `"relays"` tag. 107Issues are Markdown text that is just human-readable conversational threads related to the repository: bug reports, feature requests, questions or comments of any kind. Like patches, these SHOULD be sent to the relays specified in that repository's announcement event's `"relays"` tag.
65 108
66```jsonc 109Issues may have a `subject` tag, which clients can utilize to display a header. Additionally, one or more `t` tags may be included to provide labels for the issue.
110
111```json
67{ 112{
68 "kind": 1621, 113 "kind": 1621,
69 "content": "<markdown text>", 114 "content": "<markdown text>",
70 "tags": [ 115 "tags": [
71 ["a", "30617:<base-repo-owner-pubkey>:<base-repo-id>"], 116 ["a", "30617:<base-repo-owner-pubkey>:<base-repo-id>"],
72 ["p", "<repository-owner>"] 117 ["p", "<repository-owner>"]
118 ["subject", "<issue-subject>"]
119 ["t", "<issue-label>"]
120 ["t", "<another-issue-label>"]
73 ] 121 ]
74} 122}
75``` 123```
@@ -89,14 +137,52 @@ Replies are also Markdown text. The difference is that they MUST be issued as re
89 // other "e" and "p" tags should be applied here when necessary, following the threading rules of NIP-10 137 // other "e" and "p" tags should be applied here when necessary, following the threading rules of NIP-10
90 ["p", "<patch-author-pubkey-hex>", "", "mention"], 138 ["p", "<patch-author-pubkey-hex>", "", "mention"],
91 ["e", "<previous-reply-id-hex>", "", "reply"], 139 ["e", "<previous-reply-id-hex>", "", "reply"],
92 // ... 140 // rest of tags...
141 ],
142 // other fields...
143}
144```
145
146## Status
147
148Root Patches and Issues have a Status that defaults to 'Open' and can be set by issuing Status events.
149
150```jsonc
151{
152 "kind": 1630, // Open
153 "kind": 1631, // Applied / Merged for Patches; Resolved for Issues
154 "kind": 1632, // Closed
155 "kind": 1633, // Draft
156 "content": "<markdown text>",
157 "tags": [
158 ["e", "<issue-or-original-root-patch-id-hex>", "", "root"],
159 ["e", "<accepted-revision-root-id-hex>", "", "reply"], // for when revisions applied
160 ["p", "<repository-owner>"],
161 ["p", "<root-event-author>"],
162 ["p", "<revision-author>"],
163
164 // optional for improved subscription filter efficiency
165 ["a", "30617:<base-repo-owner-pubkey>:<base-repo-id>", "<relay-url>"],
166 ["r", "<earliest-unique-commit-id-of-repo>"]
167
168 // optional for `1631` status
169 ["e", "<applied-or-merged-patch-event-id>", "", "mention"], // for each
170 // when merged
171 ["merge-commit", "<merge-commit-id>"]
172 ["r", "<merge-commit-id>"]
173 // when applied
174 ["applied-as-commits", "<commit-id-in-master-branch>", ...]
175 ["r", "<applied-commit-id>"] // for each
93 ] 176 ]
94} 177}
95``` 178```
96 179
180The Status event with the largest created_at date is valid.
181
182The Status of a patch-revision defaults to either that of the root-patch, or `1632` (Closed) if the root-patch's Status is `1631` and the patch-revision isn't tagged in the `1631` event.
183
184
97## Possible things to be added later 185## Possible things to be added later
98 186
99- "status" kind (for letting people know a patch was merged or an issue was fixed or won't be fixed)
100- "branch merge" kind (specifying a URL from where to fetch the branch to be merged) 187- "branch merge" kind (specifying a URL from where to fetch the branch to be merged)
101- "cover letter" kind (to which multiple patches can refer and serve as a unifying layer to them)
102- inline file comments kind (we probably need one for patches and a different one for merged files) 188- inline file comments kind (we probably need one for patches and a different one for merged files)