From e3d42d6f33cfb7d7bc0900531ba28dfa453d2ed2 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 21 Jan 2024 11:02:09 -0300 Subject: [PATCH 01/16] NIP-34: git stuff. --- 34.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 34.md diff --git a/34.md b/34.md new file mode 100644 index 0000000000..e8912deca8 --- /dev/null +++ b/34.md @@ -0,0 +1,45 @@ +NIP-34 +====== + +`git` stuff +----------- + +`draft` `optional` + +This NIP defines all the ways code collaboration using and adjacent to [`git`](https://git-scm.com/) can be done using Nostr. + +## Repository announcements + +Git repositories are hosted in Git-enabled servers, but their existence can be announced using Nostr events, as well as their willingness to receive patches, bug reports and comments in general. + +```jsonc +{ + "kind": 30617, + "content": "", + "tags": [ + ["d", ""], + ["name", ""], + ["description", "brief human-readable project description>"], + ["web", ""], // a webpage url, if the git server being used provides such a thing + ["clone", ""], // a url to be given to `git clone` so anyone can clone it + ["patches", ""], // this signals that patches are welcome and will be searched for in this relay + ["issues", ""] // this signals that bug reports, questions, comments and so on are welcome + ] +} +``` + +The tags `web`, `clone`, `patches` and `issues` can be specified multiple times. + +## Patches + +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 `"patches"` tag. Patch events SHOULD include an `a` tag pointing to that repository's announcement address. + +```jsonc +{ + "kind": 1617, + "content": "", // contents of + "tags": [ + ["a", "30617::"] + ] +} +``` From 7887d7bc64a044c4c0f8b65d049e394d9255748c Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 21 Jan 2024 16:03:58 -0300 Subject: [PATCH 02/16] repository head. --- 34.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/34.md b/34.md index e8912deca8..001808275e 100644 --- a/34.md +++ b/34.md @@ -20,6 +20,7 @@ Git repositories are hosted in Git-enabled servers, but their existence can be a ["d", ""], ["name", ""], ["description", "brief human-readable project description>"], + ["head", ""], // the current repository commit head, as hex ["web", ""], // a webpage url, if the git server being used provides such a thing ["clone", ""], // a url to be given to `git clone` so anyone can clone it ["patches", ""], // this signals that patches are welcome and will be searched for in this relay @@ -28,7 +29,7 @@ Git repositories are hosted in Git-enabled servers, but their existence can be a } ``` -The tags `web`, `clone`, `patches` and `issues` can be specified multiple times. +The tags `web`, `clone`, `patches` and `issues` can be specified multiple times. Except `d`, all tags are optional. ## Patches From d86acbf5f4c8928f33f4ae8e2f79498dd30922b7 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 21 Jan 2024 16:04:07 -0300 Subject: [PATCH 03/16] threads/issues and replies. --- 34.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/34.md b/34.md index 001808275e..e3336a3e8f 100644 --- a/34.md +++ b/34.md @@ -44,3 +44,36 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor ] } ``` + +## Branch merge + +To be defined. + +## Issues + +Issues are Markdown text that is just human-readable conversational threads related to the repository: bug reports, feature requests, questions or comments of any kind. + +```jsonc +{ + "kind": 1621, + "content": "", + "tags": [ + ["a", "30617::"] + ] +} +``` + +## Replies + +Replies are also Markdown text. The difference is that they MUST refer to one root thread event. Their root doesn't have to be a `kind:1621` _issue_, but also a `kind:1617` patch event. + +```jsonc +{ + "kind": 1622, + "content": "", + "tags": [ + ["a", "30617::"], + ["e", ""], + ] +} +``` From 16d14e5e92d707a79e696d857f2cd40537d377e8 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 22 Jan 2024 21:09:32 -0300 Subject: [PATCH 04/16] add "p" optional tags to events. --- 34.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/34.md b/34.md index e3336a3e8f..69b2b5e733 100644 --- a/34.md +++ b/34.md @@ -40,7 +40,8 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor "kind": 1617, "content": "", // contents of "tags": [ - ["a", "30617::"] + ["a", "30617::"], + ["p", ""] ] } ``` @@ -58,7 +59,8 @@ Issues are Markdown text that is just human-readable conversational threads rela "kind": 1621, "content": "", "tags": [ - ["a", "30617::"] + ["a", "30617::"], + ["p", ""] ] } ``` @@ -74,6 +76,7 @@ Replies are also Markdown text. The difference is that they MUST refer to one ro "tags": [ ["a", "30617::"], ["e", ""], + ["p", ""] ] } ``` From 0b5774d33fab45fab7e798bdc7101a0104b46e7b Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 22 Jan 2024 21:09:43 -0300 Subject: [PATCH 05/16] add list of things to do later in the end. --- 34.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/34.md b/34.md index 69b2b5e733..5be41b901e 100644 --- a/34.md +++ b/34.md @@ -46,10 +46,6 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor } ``` -## Branch merge - -To be defined. - ## Issues Issues are Markdown text that is just human-readable conversational threads related to the repository: bug reports, feature requests, questions or comments of any kind. @@ -80,3 +76,9 @@ Replies are also Markdown text. The difference is that they MUST refer to one ro ] } ``` + +## Things to be added later + +- branch merge kind (specifying a URL from where to fetch the branch to be merged) +- inline file comments kind +- review type with multiple inline comments? -- or maybe this could just be an extension of the "reply" kind above From 039f5e1a0ea97bdd311836138ec92f29a1defe33 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 27 Jan 2024 21:10:13 -0300 Subject: [PATCH 06/16] multiple values in some tags instead of multiple tags. --- 34.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/34.md b/34.md index 5be41b901e..3811894dd1 100644 --- a/34.md +++ b/34.md @@ -20,16 +20,18 @@ Git repositories are hosted in Git-enabled servers, but their existence can be a ["d", ""], ["name", ""], ["description", "brief human-readable project description>"], - ["head", ""], // the current repository commit head, as hex - ["web", ""], // a webpage url, if the git server being used provides such a thing - ["clone", ""], // a url to be given to `git clone` so anyone can clone it - ["patches", ""], // this signals that patches are welcome and will be searched for in this relay - ["issues", ""] // this signals that bug reports, questions, comments and so on are welcome + ["tag", "head", ""], // the current repository commit head, as hex + ["web", "", ...], // a webpage url, if the git server being used provides such a thing + ["clone", "", ...], // a url to be given to `git clone` so anyone can clone it + ["patches", "", ...], // this signals that patches are welcome and will be searched for in this relay + ["issues", "", ...] // this signals that bug reports, questions, comments and so on are welcome ] } ``` -The tags `web`, `clone`, `patches` and `issues` can be specified multiple times. Except `d`, all tags are optional. +The tags `web`, `clone`, `patches` and `issues` can have multiple values. + +Except `d`, all tags are optional. ## Patches From 70fdfe73955ceac833b80ed95e8fc8ff35d77330 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 29 Jan 2024 21:30:25 -0300 Subject: [PATCH 07/16] replace "patches", "issues" tags and replace that with "relays". --- 34.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/34.md b/34.md index 3811894dd1..455a651c9a 100644 --- a/34.md +++ b/34.md @@ -23,19 +23,18 @@ Git repositories are hosted in Git-enabled servers, but their existence can be a ["tag", "head", ""], // the current repository commit head, as hex ["web", "", ...], // a webpage url, if the git server being used provides such a thing ["clone", "", ...], // a url to be given to `git clone` so anyone can clone it - ["patches", "", ...], // this signals that patches are welcome and will be searched for in this relay - ["issues", "", ...] // this signals that bug reports, questions, comments and so on are welcome + ["relays", "", ...] // relays that this repository will monitor for patches and issues ] } ``` -The tags `web`, `clone`, `patches` and `issues` can have multiple values. +The tags `web`, `clone`, `relays` can have multiple values. Except `d`, all tags are optional. ## Patches -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 `"patches"` tag. Patch events SHOULD include an `a` tag pointing to that repository's announcement address. +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. ```jsonc { @@ -50,7 +49,7 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor ## Issues -Issues are Markdown text that is just human-readable conversational threads related to the repository: bug reports, feature requests, questions or comments of any kind. +Issues 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. ```jsonc { From 29a6426cb8e810458afcc3c55ca9a655b0db0866 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 29 Jan 2024 21:39:45 -0300 Subject: [PATCH 08/16] bring in tags that allow for a commit id to be stable. --- 34.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/34.md b/34.md index 455a651c9a..b2eb157317 100644 --- a/34.md +++ b/34.md @@ -42,7 +42,13 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor "content": "", // contents of "tags": [ ["a", "30617::"], - ["p", ""] + ["p", ""], + + // optional tags for when it is desirable that the merged patch has a stable commit id + ["commit", ""], + ["parent-commit", ""], + ["commit-pgp-sig", "-----BEGIN PGP SIGNATURE-----..."], + ["committer", "", "", ""], ] } ``` From cb8b66a62018619ae971b98b26b58c654ea6fcb4 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 29 Jan 2024 21:44:02 -0300 Subject: [PATCH 09/16] edit "reply" kind to say it should follow normal NIP-10 threading rules. --- 34.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/34.md b/34.md index b2eb157317..43179e0779 100644 --- a/34.md +++ b/34.md @@ -77,9 +77,12 @@ Replies are also Markdown text. The difference is that they MUST refer to one ro "kind": 1622, "content": "", "tags": [ - ["a", "30617::"], - ["e", ""], - ["p", ""] + ["a", "30617::", ""], + ["e", "", "", "root"], + + // other "e" and "p" tags should be applied here when necessary, following the threading rules of NIP-10 + ["p", "", "", "mention"], + // ... ] } ``` From 23a46d3d53e862d3558c4cb10c1c96d576481865 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 29 Jan 2024 21:49:57 -0300 Subject: [PATCH 10/16] update "things to be added later". --- 34.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/34.md b/34.md index 43179e0779..f88e495d8b 100644 --- a/34.md +++ b/34.md @@ -87,8 +87,9 @@ Replies are also Markdown text. The difference is that they MUST refer to one ro } ``` -## Things to be added later +## Possible things to be added later -- branch merge kind (specifying a URL from where to fetch the branch to be merged) -- inline file comments kind -- review type with multiple inline comments? -- or maybe this could just be an extension of the "reply" kind above +- "status" kind (for letting people know a patch was merged or an issue was fixed or won't be fixed) +- "branch merge" kind (specifying a URL from where to fetch the branch to be merged) +- "cover letter" kind (to which multiple patches can refer and serve as a unifying layer to them) +- inline file comments kind (we probably need one for patches and a different one for merged files) From 157c56e7b7e0a754731e298bbab649d588f83253 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 30 Jan 2024 08:00:47 -0300 Subject: [PATCH 11/16] add commit time to "committer" tag. --- 34.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/34.md b/34.md index f88e495d8b..bd9cb6b7e6 100644 --- a/34.md +++ b/34.md @@ -48,7 +48,7 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor ["commit", ""], ["parent-commit", ""], ["commit-pgp-sig", "-----BEGIN PGP SIGNATURE-----..."], - ["committer", "", "", ""], + ["committer", "", "", "", ""], ] } ``` From cccc92976d7cc1dca4adf1f7074c7e6ed53467d7 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 30 Jan 2024 09:18:07 -0300 Subject: [PATCH 12/16] remove "head" tag. --- 34.md | 1 - 1 file changed, 1 deletion(-) diff --git a/34.md b/34.md index bd9cb6b7e6..2824bedf99 100644 --- a/34.md +++ b/34.md @@ -20,7 +20,6 @@ Git repositories are hosted in Git-enabled servers, but their existence can be a ["d", ""], ["name", ""], ["description", "brief human-readable project description>"], - ["tag", "head", ""], // the current repository commit head, as hex ["web", "", ...], // a webpage url, if the git server being used provides such a thing ["clone", "", ...], // a url to be given to `git clone` so anyone can clone it ["relays", "", ...] // relays that this repository will monitor for patches and issues From bbfb5a796e36ef897dc8977946848f1ad42c1341 Mon Sep 17 00:00:00 2001 From: fiatjaf_ Date: Tue, 30 Jan 2024 10:21:14 -0300 Subject: [PATCH 13/16] mention the possibility of mentioning others users in patches. Co-authored-by: DanConwayDev <114834599+DanConwayDev@users.noreply.github.com> --- 34.md | 1 + 1 file changed, 1 insertion(+) diff --git a/34.md b/34.md index 2824bedf99..c7f8f6d568 100644 --- a/34.md +++ b/34.md @@ -42,6 +42,7 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor "tags": [ ["a", "30617::"], ["p", ""], + ["p", ""], // optionally send the patch to another user to bring it to their attention // optional tags for when it is desirable that the merged patch has a stable commit id ["commit", ""], From d721d862a869fb2de197e1491f9f5c2ef2da2b72 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 30 Jan 2024 10:19:44 -0300 Subject: [PATCH 14/16] clarify commit-pgp-sig. --- 34.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/34.md b/34.md index c7f8f6d568..b99b8e4ab8 100644 --- a/34.md +++ b/34.md @@ -45,9 +45,12 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor ["p", ""], // optionally send the patch to another user to bring it to their attention // optional tags for when it is desirable that the merged patch has a stable commit id + // these fields are necessary for ensuring that the commit resulting from applying a patch + // has the same id as it had in the proposer's machine -- all these tags can be omitted + // if the maintainer doesn't care about these things ["commit", ""], ["parent-commit", ""], - ["commit-pgp-sig", "-----BEGIN PGP SIGNATURE-----..."], + ["commit-pgp-sig", "-----BEGIN PGP SIGNATURE-----..."], // empty string for unsigned commit ["committer", "", "", "", ""], ] } From 4ab32627f62410a5b802249a7443ffd408f1afc9 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 30 Jan 2024 10:34:18 -0300 Subject: [PATCH 15/16] clarify requirements and threading of replies. --- 34.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/34.md b/34.md index b99b8e4ab8..6794e9abd7 100644 --- a/34.md +++ b/34.md @@ -73,7 +73,7 @@ Issues are Markdown text that is just human-readable conversational threads rela ## Replies -Replies are also Markdown text. The difference is that they MUST refer to one root thread event. Their root doesn't have to be a `kind:1621` _issue_, but also a `kind:1617` patch event. +Replies are also Markdown text. The difference is that they MUST be issued as replies to either a `kind:1621` _issue_ or a `kind:1617` _patch_ event. The threading of replies and patches should follow NIP-10 rules. ```jsonc { @@ -85,6 +85,7 @@ Replies are also Markdown text. The difference is that they MUST refer to one ro // other "e" and "p" tags should be applied here when necessary, following the threading rules of NIP-10 ["p", "", "", "mention"], + ["e", "", "", "reply"], // ... ] } From 79cbe56228db8297b0a3df24ccb4f4633f1b330e Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 8 Feb 2024 10:01:14 -0300 Subject: [PATCH 16/16] add t=root tag. --- 34.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/34.md b/34.md index 6794e9abd7..651407d207 100644 --- a/34.md +++ b/34.md @@ -44,6 +44,9 @@ Patches can be sent by anyone to any repository. Patches to a specific repositor ["p", ""], ["p", ""], // optionally send the patch to another user to bring it to their attention + // for the first patch in a thread or series + ["t", "root"], + // optional tags for when it is desirable that the merged patch has a stable commit id // these fields are necessary for ensuring that the commit resulting from applying a patch // has the same id as it had in the proposer's machine -- all these tags can be omitted