upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock18
-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
-rw-r--r--test_utils/src/lib.rs2
6 files changed, 17 insertions, 23 deletions
diff --git a/flake.lock b/flake.lock
index 93f638d..cec2950 100644
--- a/flake.lock
+++ b/flake.lock
@@ -5,11 +5,11 @@
5 "systems": "systems" 5 "systems": "systems"
6 }, 6 },
7 "locked": { 7 "locked": {
8 "lastModified": 1705309234, 8 "lastModified": 1710146030,
9 "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", 9 "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
10 "owner": "numtide", 10 "owner": "numtide",
11 "repo": "flake-utils", 11 "repo": "flake-utils",
12 "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", 12 "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
13 "type": "github" 13 "type": "github"
14 }, 14 },
15 "original": { 15 "original": {
@@ -38,11 +38,11 @@
38 }, 38 },
39 "nixpkgs": { 39 "nixpkgs": {
40 "locked": { 40 "locked": {
41 "lastModified": 1706550542, 41 "lastModified": 1710806803,
42 "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", 42 "narHash": "sha256-qrxvLS888pNJFwJdK+hf1wpRCSQcqA6W5+Ox202NDa0=",
43 "owner": "NixOS", 43 "owner": "NixOS",
44 "repo": "nixpkgs", 44 "repo": "nixpkgs",
45 "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", 45 "rev": "b06025f1533a1e07b6db3e75151caa155d1c7eb3",
46 "type": "github" 46 "type": "github"
47 }, 47 },
48 "original": { 48 "original": {
@@ -81,11 +81,11 @@
81 "nixpkgs": "nixpkgs_2" 81 "nixpkgs": "nixpkgs_2"
82 }, 82 },
83 "locked": { 83 "locked": {
84 "lastModified": 1706667075, 84 "lastModified": 1711073443,
85 "narHash": "sha256-KBI5jcOWh9nsOFWj2SRq7vj+fPDf8Do8ceL582kFA70=", 85 "narHash": "sha256-PpNb4xq7U5Q/DdX40qe7CijUsqhVVM3VZrhN0+c6Lcw=",
86 "owner": "oxalica", 86 "owner": "oxalica",
87 "repo": "rust-overlay", 87 "repo": "rust-overlay",
88 "rev": "2c993daf3136c6955fd13bfe215d0d4faf6090f1", 88 "rev": "eec55ba9fcde6be4c63942827247e42afef7fafe",
89 "type": "github" 89 "type": "github"
90 }, 90 },
91 "original": { 91 "original": {
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>,
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs
index 2edbc60..a0c67df 100644
--- a/test_utils/src/lib.rs
+++ b/test_utils/src/lib.rs
@@ -574,7 +574,7 @@ impl CliTesterChoicePrompt<'_> {
574 574
575 fn show_options( 575 fn show_options(
576 tester: &mut CliTester, 576 tester: &mut CliTester,
577 choices: &Vec<String>, 577 choices: &[String],
578 selected_index: Option<usize>, 578 selected_index: Option<usize>,
579 ) -> Result<()> { 579 ) -> Result<()> {
580 if selected_index.is_some() { 580 if selected_index.is_some() {