From 6ae42e67d9da36f6c2e1356acba30a3a62112bc7 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 4 Aug 2025 08:20:30 +0100 Subject: fix: `t` tag `revision-root` ~> `root-revision` NIP-34 specifies patch revisions should have a `t` tag of `root-revision` whereas we have been using `revision-root`. this fixes it and and handles events created with the incorrect tag. --- src/lib/git_events.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/git_events.rs b/src/lib/git_events.rs index 79f5772..8ba5419 100644 --- a/src/lib/git_events.rs +++ b/src/lib/git_events.rs @@ -74,10 +74,10 @@ pub fn event_is_patch_set_root(event: &Event) -> bool { pub fn event_is_revision_root(event: &Event) -> bool { (event.kind.eq(&Kind::GitPatch) - && event - .tags - .iter() - .any(|t| t.as_slice().len() > 1 && t.as_slice()[1].eq("revision-root"))) + && event.tags.iter().any(|t| { + t.as_slice().len() > 1 + && ["revision-root", "root-revision"].contains(&t.as_slice()[1].as_str()) + })) || (event.kind.eq(&KIND_PULL_REQUEST) && event .tags @@ -179,7 +179,7 @@ pub async fn generate_patch_event( } else if let Some(event_ref) = root_proposal_id.clone() { vec![ Tag::hashtag("root"), - Tag::hashtag("revision-root"), + Tag::hashtag("root-revision"), // TODO check if id is for a root proposal (perhaps its for an issue?) event_tag_from_nip19_or_hex( &event_ref, @@ -598,7 +598,7 @@ pub async fn generate_cover_letter_and_patch_events( if let Some(event_ref) = root_proposal_id.clone() { vec![ Tag::hashtag("root"), - Tag::hashtag("revision-root"), + Tag::hashtag("root-revision"), // TODO check if id is for a root proposal (perhaps its for an issue?) event_tag_from_nip19_or_hex(&event_ref,"proposal",EventRefType::Reply, false, false)?, ] -- cgit v1.2.3