diff options
| author | Oscar Merry <MerryOscar@users.noreply.github.com> | 2024-08-05 23:08:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-05 23:08:41 +0100 |
| commit | 29eec055c2ccf115dae3e8560506b480f1a6de05 (patch) | |
| tree | 634fa65565d0bf40eca479de9851c0c95058af72 /34.md | |
| parent | 13b830d228b122b29f9d96a3bf10601406ddd646 (diff) | |
| parent | 428a4779d7c4f4c2ff53815e8958e7cf99d69d26 (diff) | |
Merge branch 'nostr-protocol:master' into external-content-ids
Diffstat (limited to '34.md')
| -rw-r--r-- | 34.md | 32 |
1 files changed, 31 insertions, 1 deletions
| @@ -35,6 +35,36 @@ The `r` tag annotated with the `"euc"` marker should be the commit ID of the ear | |||
| 35 | 35 | ||
| 36 | Except `d`, all tags are optional. | 36 | Except `d`, all tags are optional. |
| 37 | 37 | ||
| 38 | ## Repository state announcements | ||
| 39 | |||
| 40 | An 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 | |||
| 54 | The `refs` tag may appear multiple times, or none. | ||
| 55 | |||
| 56 | If 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. | ||
| 57 | |||
| 58 | The `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 | |||
| 38 | ## Patches | 68 | ## Patches |
| 39 | 69 | ||
| 40 | Patches 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. | 70 | Patches 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. |
| @@ -53,7 +83,7 @@ The first patch revision in a patch revision SHOULD include a NIP-10 `e` `reply` | |||
| 53 | ["p", "<repository-owner>"], | 83 | ["p", "<repository-owner>"], |
| 54 | ["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 |
| 55 | 85 | ||
| 56 | ["t", "root"], // ommited for additional patches in a series | 86 | ["t", "root"], // omitted for additional patches in a series |
| 57 | // for the first patch in a revision | 87 | // for the first patch in a revision |
| 58 | ["t", "root-revision"], | 88 | ["t", "root-revision"], |
| 59 | 89 | ||