upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/sub_commands/pull.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-02-13 06:27:34 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-02-13 06:27:34 +0000
commit3112576195aef212622d27ad9164336796c1953e (patch)
tree0e897bcb8309c2d4c8f33d7c1590c2dcc0577508 /src/sub_commands/pull.rs
parent9cd3e43b899b23b7f6e75276fa3d19bf9550f8fd (diff)
feat(prs-create)!: pr to nip34-like cover letter
up the pr event type to a nip34-like cover letter format this sets the building blocks in place to enable simplier clients to use the 'cover letter' feature in `git format-patch` to create the experience as a pr event
Diffstat (limited to 'src/sub_commands/pull.rs')
-rw-r--r--src/sub_commands/pull.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/sub_commands/pull.rs b/src/sub_commands/pull.rs
index c426510..f3ae81f 100644
--- a/src/sub_commands/pull.rs
+++ b/src/sub_commands/pull.rs
@@ -8,6 +8,7 @@ use crate::{
8 client::Connect, 8 client::Connect,
9 git::{Repo, RepoActions}, 9 git::{Repo, RepoActions},
10 repo_ref, 10 repo_ref,
11 repo_ref::REPO_REF_KIND,
11 sub_commands::prs::{ 12 sub_commands::prs::{
12 create::{PATCH_KIND, PR_KIND}, 13 create::{PATCH_KIND, PR_KIND},
13 list::{get_most_recent_patch_with_ancestors, tag_value}, 14 list::{get_most_recent_patch_with_ancestors, tag_value},
@@ -53,7 +54,12 @@ pub async fn launch() -> Result<()> {
53 vec![ 54 vec![
54 nostr::Filter::default() 55 nostr::Filter::default()
55 .kind(nostr::Kind::Custom(PR_KIND)) 56 .kind(nostr::Kind::Custom(PR_KIND))
56 .reference(format!("r-{root_commit}")), 57 .identifiers(
58 repo_ref
59 .maintainers
60 .iter()
61 .map(|m| format!("{REPO_REF_KIND}:{m}:{}", repo_ref.identifier)),
62 ),
57 ], 63 ],
58 ) 64 )
59 .await? 65 .await?
@@ -62,7 +68,7 @@ pub async fn launch() -> Result<()> {
62 e.kind.as_u64() == PR_KIND 68 e.kind.as_u64() == PR_KIND
63 && e.tags 69 && e.tags
64 .iter() 70 .iter()
65 .any(|t| t.as_vec().len() > 1 && t.as_vec()[1].eq(&format!("r-{root_commit}"))) 71 .any(|t| t.as_vec().len() > 1 && t.as_vec()[1].eq(&format!("{root_commit}")))
66 && tag_value(e, "branch-name") 72 && tag_value(e, "branch-name")
67 .unwrap_or_default() 73 .unwrap_or_default()
68 .eq(&branch_name) 74 .eq(&branch_name)