upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-03-22 07:35:24 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-03-22 15:45:04 +0000
commit91a68de459b7d22a8dfb8a324e43740fca3e0a35 (patch)
tree43c35999b928b04bba4ce4d9d9252133c69bffde /src
parentec1d5ca85891ddb083fb2c0e484d5ebf0be9d13f (diff)
chore: nix flake update
update nix dependancies to latest version using default update options
Diffstat (limited to 'src')
-rw-r--r--src/git.rs4
-rw-r--r--src/main.rs4
-rw-r--r--src/sub_commands/list.rs10
-rw-r--r--src/sub_commands/send.rs2
4 files changed, 7 insertions, 13 deletions
diff --git a/src/git.rs b/src/git.rs
index 5afb1e4..86b59fb 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -45,9 +45,11 @@ pub trait RepoActions {
45 fn get_commit_parent(&self, commit: &Sha1Hash) -> Result<Sha1Hash>; 45 fn get_commit_parent(&self, commit: &Sha1Hash) -> Result<Sha1Hash>;
46 fn get_commit_message(&self, commit: &Sha1Hash) -> Result<String>; 46 fn get_commit_message(&self, commit: &Sha1Hash) -> Result<String>;
47 fn get_commit_message_summary(&self, commit: &Sha1Hash) -> Result<String>; 47 fn get_commit_message_summary(&self, commit: &Sha1Hash) -> Result<String>;
48 #[allow(clippy::doc_link_with_quotes)]
48 /// returns vector ["name", "email", "unixtime", "offset"] 49 /// returns vector ["name", "email", "unixtime", "offset"]
49 /// eg ["joe bloggs", "joe@pm.me", "12176","-300"] 50 /// eg ["joe bloggs", "joe@pm.me", "12176","-300"]
50 fn get_commit_author(&self, commit: &Sha1Hash) -> Result<Vec<String>>; 51 fn get_commit_author(&self, commit: &Sha1Hash) -> Result<Vec<String>>;
52 #[allow(clippy::doc_link_with_quotes)]
51 /// returns vector ["name", "email", "unixtime", "offset"] 53 /// returns vector ["name", "email", "unixtime", "offset"]
52 /// eg ["joe bloggs", "joe@pm.me", "12176","-300"] 54 /// eg ["joe bloggs", "joe@pm.me", "12176","-300"]
53 fn get_commit_comitter(&self, commit: &Sha1Hash) -> Result<Vec<String>>; 55 fn get_commit_comitter(&self, commit: &Sha1Hash) -> Result<Vec<String>>;
@@ -1681,7 +1683,7 @@ mod tests {
1681 let mut events = generate_cover_letter_and_patch_events( 1683 let mut events = generate_cover_letter_and_patch_events(
1682 Some(("test".to_string(), "test".to_string())), 1684 Some(("test".to_string(), "test".to_string())),
1683 &git_repo, 1685 &git_repo,
1684 &vec![oid_to_sha1(&oid1), oid_to_sha1(&oid2), oid_to_sha1(&oid3)], 1686 &[oid_to_sha1(&oid1), oid_to_sha1(&oid2), oid_to_sha1(&oid3)],
1685 &TEST_KEY_1_KEYS, 1687 &TEST_KEY_1_KEYS,
1686 &RepoRef::try_from(generate_repo_ref_event()).unwrap(), 1688 &RepoRef::try_from(generate_repo_ref_event()).unwrap(),
1687 &None, 1689 &None,
diff --git a/src/main.rs b/src/main.rs
index adffdec..30ecea3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -37,7 +37,7 @@ enum Commands {
37 /// issue commits as a proposal 37 /// issue commits as a proposal
38 Send(sub_commands::send::SubCommandArgs), 38 Send(sub_commands::send::SubCommandArgs),
39 /// list proposals; checkout, apply or download selected 39 /// list proposals; checkout, apply or download selected
40 List(sub_commands::list::SubCommandArgs), 40 List,
41 /// send proposal revision 41 /// send proposal revision
42 Push(sub_commands::push::SubCommandArgs), 42 Push(sub_commands::push::SubCommandArgs),
43 /// fetch and apply new proposal commits / revisions linked to branch 43 /// fetch and apply new proposal commits / revisions linked to branch
@@ -53,7 +53,7 @@ async fn main() -> Result<()> {
53 Commands::Login(args) => sub_commands::login::launch(&cli, args).await, 53 Commands::Login(args) => sub_commands::login::launch(&cli, args).await,
54 Commands::Init(args) => sub_commands::init::launch(&cli, args).await, 54 Commands::Init(args) => sub_commands::init::launch(&cli, args).await,
55 Commands::Send(args) => sub_commands::send::launch(&cli, args).await, 55 Commands::Send(args) => sub_commands::send::launch(&cli, args).await,
56 Commands::List(args) => sub_commands::list::launch(&cli, args).await, 56 Commands::List => sub_commands::list::launch().await,
57 Commands::Pull => sub_commands::pull::launch().await, 57 Commands::Pull => sub_commands::pull::launch().await,
58 Commands::Push(args) => sub_commands::push::launch(&cli, args).await, 58 Commands::Push(args) => sub_commands::push::launch(&cli, args).await,
59 } 59 }
diff --git a/src/sub_commands/list.rs b/src/sub_commands/list.rs
index 102c3bd..2d81164 100644
--- a/src/sub_commands/list.rs
+++ b/src/sub_commands/list.rs
@@ -16,18 +16,10 @@ use crate::{
16 commit_msg_from_patch_oneliner, event_is_cover_letter, event_is_revision_root, 16 commit_msg_from_patch_oneliner, event_is_cover_letter, event_is_revision_root,
17 event_to_cover_letter, patch_supports_commit_ids, PATCH_KIND, 17 event_to_cover_letter, patch_supports_commit_ids, PATCH_KIND,
18 }, 18 },
19 Cli,
20}; 19};
21 20
22#[derive(Debug, clap::Args)]
23pub struct SubCommandArgs {
24 /// TODO ignore merged, and closed
25 #[arg(long, action)]
26 open_only: bool,
27}
28
29#[allow(clippy::too_many_lines)] 21#[allow(clippy::too_many_lines)]
30pub async fn launch(_cli_args: &Cli, _args: &SubCommandArgs) -> Result<()> { 22pub async fn launch() -> Result<()> {
31 let git_repo = Repo::discover().context("cannot find a git repository")?; 23 let git_repo = Repo::discover().context("cannot find a git repository")?;
32 24
33 let root_commit = git_repo 25 let root_commit = git_repo
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs
index 81cecd8..35c2c81 100644
--- a/src/sub_commands/send.rs
+++ b/src/sub_commands/send.rs
@@ -518,7 +518,7 @@ pub static PATCH_KIND: u64 = 1617;
518pub fn generate_cover_letter_and_patch_events( 518pub fn generate_cover_letter_and_patch_events(
519 cover_letter_title_description: Option<(String, String)>, 519 cover_letter_title_description: Option<(String, String)>,
520 git_repo: &Repo, 520 git_repo: &Repo,
521 commits: &Vec<Sha1Hash>, 521 commits: &[Sha1Hash],
522 keys: &nostr::Keys, 522 keys: &nostr::Keys,
523 repo_ref: &RepoRef, 523 repo_ref: &RepoRef,
524 in_reply_to: &Option<String>, 524 in_reply_to: &Option<String>,