Avatar
DanConwayDev
a008def15796fba9a0d6fab04e8fd57089285d9fd505da5a83fe8aad57a3564d
freedom tech developer and creator of ngit, https://gitworkshop.dev and https://metadata.nostr.com
Replying to Avatar Santos

From 9127eb2e840f90c55e9d116b7fd368cc5fe610d7 Mon Sep 17 00:00:00 2001

From: sant0s12

Date: Fri, 1 Mar 2024 11:42:14 +0100

Subject: [PATCH] Add svelte-french-toast

---

package-lock.json | 23 +++++++++++++++++++++++

package.json | 1 +

2 files changed, 24 insertions(+)

diff --git a/package-lock.json b/package-lock.json

index e86758d..d0b75e5 100644

--- a/package-lock.json

+++ b/package-lock.json

@@ -12,6 +12,7 @@

"lodash-es": "^4.17.21",

"nostr-tools": "^2.1.7",

"p-limit": "^5.0.0",

+ "svelte-french-toast": "^1.2.0",

"svelte-infinite-loading": "^1.3.8",

"svelte-persisted-store": "^0.9.1",

"tailwind-merge": "^2.2.1"

@@ -6098,6 +6099,17 @@

"svelte": "^3.55.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0"

}

},

+ "node_modules/svelte-french-toast": {

+ "version": "1.2.0",

+ "resolved": "https://registry.npmjs.org/svelte-french-toast/-/svelte-french-toast-1.2.0.tgz",

+ "integrity": "sha512-5PW+6RFX3xQPbR44CngYAP1Sd9oCq9P2FOox4FZffzJuZI2mHOB7q5gJBVnOiLF5y3moVGZ7u2bYt7+yPAgcEQ==",

+ "dependencies": {

+ "svelte-writable-derived": "^3.1.0"

+ },

+ "peerDependencies": {

+ "svelte": "^3.57.0 || ^4.0.0"

+ }

+ },

"node_modules/svelte-infinite-loading": {

"version": "1.3.8",

"resolved": "https://registry.npmjs.org/svelte-infinite-loading/-/svelte-infinite-loading-1.3.8.tgz",

@@ -6177,6 +6189,17 @@

}

}

},

+ "node_modules/svelte-writable-derived": {

+ "version": "3.1.0",

+ "resolved": "https://registry.npmjs.org/svelte-writable-derived/-/svelte-writable-derived-3.1.0.tgz",

+ "integrity": "sha512-cTvaVFNIJ036vSDIyPxJYivKC7ZLtcFOPm1Iq6qWBDo1fOHzfk6ZSbwaKrxhjgy52Rbl5IHzRcWgos6Zqn9/rg==",

+ "funding": {

+ "url": "https://ko-fi.com/pixievoltno1"

+ },

+ "peerDependencies": {

+ "svelte": "^3.2.1 || ^4.0.0-next.1"

+ }

+ },

"node_modules/svg.draggable.js": {

"version": "2.2.2",

"resolved": "https://registry.npmjs.org/svg.draggable.js/-/svg.draggable.js-2.2.2.tgz",

diff --git a/package.json b/package.json

index 9eb424c..b01e26c 100644

--- a/package.json

+++ b/package.json

@@ -48,6 +48,7 @@

"lodash-es": "^4.17.21",

"nostr-tools": "^2.1.7",

"p-limit": "^5.0.0",

+ "svelte-french-toast": "^1.2.0",

"svelte-infinite-loading": "^1.3.8",

"svelte-persisted-store": "^0.9.1",

"tailwind-merge": "^2.2.1"

--

libgit2 1.7.2

I like french toast! thanks for trying out ngit and gitworkshop.dev! this is what a reply to your proposal looks like. Do notifications for this reply look ok on the social nostr client you use?

haha! it is in rust. if only there was 'you should rewrite it in go' meme...

there is innovation happening with git and nostr in a few places. gitworkshop.dev aims to work with different approaches. ngit is more opinionated, focusing on patches over nostr with backwards-compatible and optional support for PR-like workflows

its easy for maintainers to try out on an existing project without effecting your existing collaboration set up (eg GitHub). maintainers can just install ngit and run `ngit init` from their local git repository to being accepting patches / proposal

ANOUNCEMENT: first release of ngit and gitworkshop.dev

i'd love your feedback, its really easy for repository maintainers to try out.

https://gitworkshop.dev treat it as alpha

Replying to Avatar DanConwayDev

From 56631c1d5bc2ba08b0a51fc532b89812444494b4 Mon Sep 17 00:00:00 2001

From: DanConwayDev

Date: Fri, 1 Mar 2024 08:24:27 +0000

Subject: [PATCH] fix: filter out non-root patches in proposal lists

prevent non-root patches from displaying on homepage where possible

via client side filter for non-root patches on repositories

that support the latest nip34 spec

on repository pages this is included in the relay subscription but when

we are getting patches for all repositories, like on the homepage,

we don't know ahead of time which ones support the latest spec

---

src/lib/stores/Proposals.ts | 33 ++++++++++++++++++++++++++++++---

src/lib/stores/repos.ts | 15 +++++++++++++++

2 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/src/lib/stores/Proposals.ts b/src/lib/stores/Proposals.ts

index e772d37..40f9bde 100644

--- a/src/lib/stores/Proposals.ts

+++ b/src/lib/stores/Proposals.ts

@@ -19,6 +19,7 @@ import {

} from '$lib/kinds'

import { extractPatchMessage } from '$lib/components/events/content/utils'

import { selectRepoFromCollection } from '$lib/components/repo/utils'

+import { returnRepoCollection } from './repos'

export const proposal_summaries: Writable = writable({

id: '',

@@ -106,7 +107,7 @@ export const ensureProposalSummaries = async (repo_id: string | undefined) => {

NDKRelaySet.fromRelayUrls(relays_to_use, ndk)

)

- sub.on('event', (event: NDKEvent) => {

+ sub.on('event', async (event: NDKEvent) => {

try {

if (

event.kind == patch_kind &&

@@ -117,6 +118,9 @@ export const ensureProposalSummaries = async (repo_id: string | undefined) => {

// link to proposal will not work as it requires an identifier

return

}

+ const repo_identifier =

+ extractRepoIdentiferFromProposalEvent(event) || repo_id || ''

+

proposal_summaries.update((proposals) => {

return {

...proposals,

@@ -125,8 +129,7 @@ export const ensureProposalSummaries = async (repo_id: string | undefined) => {

{

...summary_defaults,

id: event.id,

- repo_identifier:

- extractRepoIdentiferFromProposalEvent(event) || repo_id || '',

+ repo_identifier,

title: (

event.tagValue('name') ||

event.tagValue('description') ||

@@ -146,6 +149,30 @@ export const ensureProposalSummaries = async (repo_id: string | undefined) => {

],

}

})

+

+ // filter out non root proposals if repo event supports nip34+ features

+ if (!repo_id && repo_identifier.length > 0) {

+ const repo_collection = await returnRepoCollection(repo_identifier)

+ if (repo_collection.unique_commit) {

+ proposal_summaries.update((proposals) => {

+ return {

+ ...proposals,

+ summaries: [

+ ...proposals.summaries.filter(

+ (summary) =>

+ (event.tags.some(

+ (t) => t.length > 1 && t[1] === 'root'

+ ) &&

+ !event.tags.some(

+ (t) => t.length > 1 && t[1] === 'revision-root'

+ )) ||

+ event.id !== summary.id

+ ),

+ ],

+ }

+ })

+ }

+ }

}

authors_unsubscribers.push(

diff --git a/src/lib/stores/repos.ts b/src/lib/stores/repos.ts

index 2205bde..3c4d4cc 100644

--- a/src/lib/stores/repos.ts

+++ b/src/lib/stores/repos.ts

@@ -17,6 +17,21 @@ export const repos: {

[unique_commit_or_identifier: string]: Writable

} = {}

+export const returnRepoCollection = async (

+ unique_commit_or_identifier: string

+): Promise => {

+ return new Promise((r) => {

+ const unsubscriber = ensureRepoCollection(

+ unique_commit_or_identifier

+ ).subscribe((c) => {

+ if (!c.loading) {

+ unsubscriber()

+ r(c)

+ }

+ })

+ })

+}

+

export const ensureRepoCollection = (

unique_commit_or_identifier: string

): Writable => {

--

libgit2 1.7.1

tested and works as expected

I'm thinking of switching to kind 1. If i don't, nobody is going to see any discussion, or see any notifications, unless they go to specific clients. It would be much harder to build momentum.

having the humility to reconsider and ghange our minds is a trait of the best of us. to believe is human; to doubt, divine.

isn't that redefining kind-1 from nip01 from a 'text-note' to a 'social media broadcast message or reply'?

nip01 defines kind1 as: "**text note**: the `content` is set to the **plaintext** content of a note (anything the user wants to say)."

Do you mean in nip01 where it say the following?

`1`: **text note**: the `content` is set to the **plaintext** content of a note (anything the user wants to say). Content that must be parsed, such as Markdown and HTML, should not be used. Clients should also not parse content as those.

its would difficult to ensure tagged get notified if option 3 or if option 2 doesn't have widespread support

what kind should replies to non-kind-1 events be?

1) kind 1

2) non-broadcast generic reply kind

3) use case specific kind

Sounds great!

Here is how I see it working:

The merge button sends a merge/apply request event, which optionally specifies conflict resolution preferences.

A maintainer has set up a service that has an account with the git server which is authorised to push to push to main branch of the git repo. It watches for mergerequest event and on receipt does the following:

clones the repo and applies the patch against the tip of master. It either resolves the conflicts automatically and sends a merge/applied event (specifying the commit id) or sends a failed with unresolved conflicts event.

There could also be a DVM for running CI and reporting back but that doesn't need any authorisation from a maintainer.

What do you think?

Interesting. It never occurred to me that you wouldnt just restore the latest version that was on record and rebuild from there.

Is it because you didn't realise it was lost until you added some more people?

Its nice to see what people are using. Its interesting to see changing the diff algorithm and custom context lines in there.

Its on my list to add support for specifying patches files in `ngit send` so people could go to town with specifying options in `git format-patch` before sending them over nostr.

I nearly did that today but got timed out.

Replying to Avatar fiatjaf

I have been telling people to use https://metadata.nostr.com/ to recover lost follow lists, but when I tried to use it I learned it isn't very good for that, so I wrote https://follows.nostr.com/, which focuses on just that one thing and hopefully does it well enough.

Why isn't https://metadata.nostr.com very good for follow lists?