diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-12-16 09:00:46 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-12-16 09:46:30 +0000 |
| commit | 4ee83e2fe5335a8afd78439c35f029c4a472e797 (patch) | |
| tree | bdb111b191e7a68cb74ce29b4bb2757b4b7be91f /src/bin/ngit/sub_commands | |
| parent | 5fe839e2bf8ceb2931c1984efb2d956980431203 (diff) | |
chore: bump nix flake rust nightly `fmt` overlay
update the rust nightly `fmt` overlay which needs to be pinned
to a specific version (this case by date)
update formatting in main files via `cargo fmt`
Diffstat (limited to 'src/bin/ngit/sub_commands')
| -rw-r--r-- | src/bin/ngit/sub_commands/export_keys.rs | 2 | ||||
| -rw-r--r-- | src/bin/ngit/sub_commands/init.rs | 12 | ||||
| -rw-r--r-- | src/bin/ngit/sub_commands/list.rs | 19 | ||||
| -rw-r--r-- | src/bin/ngit/sub_commands/login.rs | 4 | ||||
| -rw-r--r-- | src/bin/ngit/sub_commands/logout.rs | 2 | ||||
| -rw-r--r-- | src/bin/ngit/sub_commands/send.rs | 17 |
6 files changed, 26 insertions, 30 deletions
diff --git a/src/bin/ngit/sub_commands/export_keys.rs b/src/bin/ngit/sub_commands/export_keys.rs index 54a716f..45b1b89 100644 --- a/src/bin/ngit/sub_commands/export_keys.rs +++ b/src/bin/ngit/sub_commands/export_keys.rs | |||
| @@ -2,9 +2,9 @@ use anyhow::{Context, Result}; | |||
| 2 | use ngit::{ | 2 | use ngit::{ |
| 3 | cli_interactor::{Interactor, InteractorPrompt, PromptChoiceParms}, | 3 | cli_interactor::{Interactor, InteractorPrompt, PromptChoiceParms}, |
| 4 | login::{ | 4 | login::{ |
| 5 | SignerInfo, SignerInfoSource, | ||
| 5 | existing::{get_signer_info, load_existing_login}, | 6 | existing::{get_signer_info, load_existing_login}, |
| 6 | fresh::generate_qr, | 7 | fresh::generate_qr, |
| 7 | SignerInfo, SignerInfoSource, | ||
| 8 | }, | 8 | }, |
| 9 | }; | 9 | }; |
| 10 | 10 | ||
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index 0894f41..80e182b 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs | |||
| @@ -3,18 +3,18 @@ use std::collections::HashMap; | |||
| 3 | use anyhow::{Context, Result}; | 3 | use anyhow::{Context, Result}; |
| 4 | use console::Style; | 4 | use console::Style; |
| 5 | use ngit::{cli_interactor::PromptConfirmParms, git::nostr_url::NostrUrlDecoded}; | 5 | use ngit::{cli_interactor::PromptConfirmParms, git::nostr_url::NostrUrlDecoded}; |
| 6 | use nostr::{nips::nip01::Coordinate, FromBech32, PublicKey, ToBech32}; | 6 | use nostr::{FromBech32, PublicKey, ToBech32, nips::nip01::Coordinate}; |
| 7 | use nostr_sdk::{Kind, RelayUrl}; | 7 | use nostr_sdk::{Kind, RelayUrl}; |
| 8 | 8 | ||
| 9 | use crate::{ | 9 | use crate::{ |
| 10 | cli::{extract_signer_cli_arguments, Cli}, | 10 | cli::{Cli, extract_signer_cli_arguments}, |
| 11 | cli_interactor::{Interactor, InteractorPrompt, PromptInputParms}, | 11 | cli_interactor::{Interactor, InteractorPrompt, PromptInputParms}, |
| 12 | client::{fetching_with_report, get_repo_ref_from_cache, send_events, Client, Connect}, | 12 | client::{Client, Connect, fetching_with_report, get_repo_ref_from_cache, send_events}, |
| 13 | git::{nostr_url::convert_clone_url_to_https, Repo, RepoActions}, | 13 | git::{Repo, RepoActions, nostr_url::convert_clone_url_to_https}, |
| 14 | login, | 14 | login, |
| 15 | repo_ref::{ | 15 | repo_ref::{ |
| 16 | extract_pks, get_repo_config_from_yaml, save_repo_config_to_yaml, | 16 | RepoRef, extract_pks, get_repo_config_from_yaml, save_repo_config_to_yaml, |
| 17 | try_and_get_repo_coordinates_when_remote_unknown, RepoRef, | 17 | try_and_get_repo_coordinates_when_remote_unknown, |
| 18 | }, | 18 | }, |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
diff --git a/src/bin/ngit/sub_commands/list.rs b/src/bin/ngit/sub_commands/list.rs index ee015ef..9b84c1b 100644 --- a/src/bin/ngit/sub_commands/list.rs +++ b/src/bin/ngit/sub_commands/list.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use std::{io::Write, ops::Add}; | 1 | use std::{io::Write, ops::Add}; |
| 2 | 2 | ||
| 3 | use anyhow::{bail, Context, Result}; | 3 | use anyhow::{Context, Result, bail}; |
| 4 | use ngit::{ | 4 | use ngit::{ |
| 5 | client::{get_all_proposal_patch_events_from_cache, get_proposals_and_revisions_from_cache}, | 5 | client::{get_all_proposal_patch_events_from_cache, get_proposals_and_revisions_from_cache}, |
| 6 | git_events::{ | 6 | git_events::{ |
| @@ -12,9 +12,9 @@ use nostr_sdk::Kind; | |||
| 12 | use crate::{ | 12 | use crate::{ |
| 13 | cli_interactor::{Interactor, InteractorPrompt, PromptChoiceParms, PromptConfirmParms}, | 13 | cli_interactor::{Interactor, InteractorPrompt, PromptChoiceParms, PromptConfirmParms}, |
| 14 | client::{ | 14 | client::{ |
| 15 | fetching_with_report, get_events_from_local_cache, get_repo_ref_from_cache, Client, Connect, | 15 | Client, Connect, fetching_with_report, get_events_from_local_cache, get_repo_ref_from_cache, |
| 16 | }, | 16 | }, |
| 17 | git::{str_to_sha1, Repo, RepoActions}, | 17 | git::{Repo, RepoActions, str_to_sha1}, |
| 18 | git_events::{ | 18 | git_events::{ |
| 19 | commit_msg_from_patch_oneliner, event_is_revision_root, event_to_cover_letter, | 19 | commit_msg_from_patch_oneliner, event_is_revision_root, event_to_cover_letter, |
| 20 | patch_supports_commit_ids, | 20 | patch_supports_commit_ids, |
| @@ -47,14 +47,11 @@ pub async fn launch() -> Result<()> { | |||
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | let statuses: Vec<nostr::Event> = { | 49 | let statuses: Vec<nostr::Event> = { |
| 50 | let mut statuses = get_events_from_local_cache( | 50 | let mut statuses = get_events_from_local_cache(git_repo_path, vec![ |
| 51 | git_repo_path, | 51 | nostr::Filter::default() |
| 52 | vec![ | 52 | .kinds(status_kinds().clone()) |
| 53 | nostr::Filter::default() | 53 | .events(proposals_and_revisions.iter().map(|e| e.id)), |
| 54 | .kinds(status_kinds().clone()) | 54 | ]) |
| 55 | .events(proposals_and_revisions.iter().map(|e| e.id)), | ||
| 56 | ], | ||
| 57 | ) | ||
| 58 | .await?; | 55 | .await?; |
| 59 | statuses.sort_by_key(|e| e.created_at); | 56 | statuses.sort_by_key(|e| e.created_at); |
| 60 | statuses.reverse(); | 57 | statuses.reverse(); |
diff --git a/src/bin/ngit/sub_commands/login.rs b/src/bin/ngit/sub_commands/login.rs index ccbdf01..06236ec 100644 --- a/src/bin/ngit/sub_commands/login.rs +++ b/src/bin/ngit/sub_commands/login.rs | |||
| @@ -3,11 +3,11 @@ use clap; | |||
| 3 | use ngit::{ | 3 | use ngit::{ |
| 4 | cli_interactor::{Interactor, InteractorPrompt, PromptChoiceParms}, | 4 | cli_interactor::{Interactor, InteractorPrompt, PromptChoiceParms}, |
| 5 | git::{get_git_config_item, remove_git_config_item}, | 5 | git::{get_git_config_item, remove_git_config_item}, |
| 6 | login::{existing::load_existing_login, SignerInfoSource}, | 6 | login::{SignerInfoSource, existing::load_existing_login}, |
| 7 | }; | 7 | }; |
| 8 | 8 | ||
| 9 | use crate::{ | 9 | use crate::{ |
| 10 | cli::{extract_signer_cli_arguments, Cli}, | 10 | cli::{Cli, extract_signer_cli_arguments}, |
| 11 | client::{Client, Connect}, | 11 | client::{Client, Connect}, |
| 12 | git::Repo, | 12 | git::Repo, |
| 13 | login::fresh::fresh_login_or_signup, | 13 | login::fresh::fresh_login_or_signup, |
diff --git a/src/bin/ngit/sub_commands/logout.rs b/src/bin/ngit/sub_commands/logout.rs index f3f9620..2df96c8 100644 --- a/src/bin/ngit/sub_commands/logout.rs +++ b/src/bin/ngit/sub_commands/logout.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use anyhow::{Context, Result}; | 1 | use anyhow::{Context, Result}; |
| 2 | use ngit::{ | 2 | use ngit::{ |
| 3 | git::remove_git_config_item, | 3 | git::remove_git_config_item, |
| 4 | login::{existing::load_existing_login, SignerInfoSource}, | 4 | login::{SignerInfoSource, existing::load_existing_login}, |
| 5 | }; | 5 | }; |
| 6 | 6 | ||
| 7 | use crate::{ | 7 | use crate::{ |
diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs index c6c75c9..7c898bc 100644 --- a/src/bin/ngit/sub_commands/send.rs +++ b/src/bin/ngit/sub_commands/send.rs | |||
| @@ -1,23 +1,23 @@ | |||
| 1 | use std::path::Path; | 1 | use std::path::Path; |
| 2 | 2 | ||
| 3 | use anyhow::{bail, Context, Result}; | 3 | use anyhow::{Context, Result, bail}; |
| 4 | use console::Style; | 4 | use console::Style; |
| 5 | use ngit::{client::send_events, git_events::generate_cover_letter_and_patch_events}; | 5 | use ngit::{client::send_events, git_events::generate_cover_letter_and_patch_events}; |
| 6 | use nostr::{ | 6 | use nostr::{ |
| 7 | nips::{nip10::Marker, nip19::Nip19Event}, | ||
| 8 | ToBech32, | 7 | ToBech32, |
| 8 | nips::{nip10::Marker, nip19::Nip19Event}, | ||
| 9 | }; | 9 | }; |
| 10 | use nostr_sdk::hashes::sha1::Hash as Sha1Hash; | 10 | use nostr_sdk::hashes::sha1::Hash as Sha1Hash; |
| 11 | 11 | ||
| 12 | use crate::{ | 12 | use crate::{ |
| 13 | cli::{extract_signer_cli_arguments, Cli}, | 13 | cli::{Cli, extract_signer_cli_arguments}, |
| 14 | cli_interactor::{ | 14 | cli_interactor::{ |
| 15 | Interactor, InteractorPrompt, PromptConfirmParms, PromptInputParms, PromptMultiChoiceParms, | 15 | Interactor, InteractorPrompt, PromptConfirmParms, PromptInputParms, PromptMultiChoiceParms, |
| 16 | }, | 16 | }, |
| 17 | client::{ | 17 | client::{ |
| 18 | fetching_with_report, get_events_from_local_cache, get_repo_ref_from_cache, Client, Connect, | 18 | Client, Connect, fetching_with_report, get_events_from_local_cache, get_repo_ref_from_cache, |
| 19 | }, | 19 | }, |
| 20 | git::{identify_ahead_behind, Repo, RepoActions}, | 20 | git::{Repo, RepoActions, identify_ahead_behind}, |
| 21 | git_events::{event_is_patch_set_root, event_tag_from_nip19_or_hex}, | 21 | git_events::{event_is_patch_set_root, event_tag_from_nip19_or_hex}, |
| 22 | login, | 22 | login, |
| 23 | repo_ref::get_repo_coordinates_when_remote_unknown, | 23 | repo_ref::get_repo_coordinates_when_remote_unknown, |
| @@ -369,10 +369,9 @@ async fn get_root_proposal_id_and_mentions_from_in_reply_to( | |||
| 369 | public_key: _, | 369 | public_key: _, |
| 370 | uppercase: false, | 370 | uppercase: false, |
| 371 | }) => { | 371 | }) => { |
| 372 | let events = get_events_from_local_cache( | 372 | let events = get_events_from_local_cache(git_repo_path, vec![ |
| 373 | git_repo_path, | 373 | nostr::Filter::new().id(*event_id), |
| 374 | vec![nostr::Filter::new().id(*event_id)], | 374 | ]) |
| 375 | ) | ||
| 376 | .await?; | 375 | .await?; |
| 377 | 376 | ||
| 378 | if let Some(first) = events.iter().find(|e| e.id.eq(event_id)) { | 377 | if let Some(first) = events.iter().find(|e| e.id.eq(event_id)) { |