From 89c51886afd54afd901995916909ba98e764b23e Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 22 Feb 2024 16:27:18 +0000 Subject: refactor: fix spelling ammended should read amended --- src/git.rs | 2 +- src/main.rs | 2 +- src/sub_commands/list.rs | 14 +++++++------- src/sub_commands/pull.rs | 14 +++++++------- tests/list.rs | 10 +++++----- tests/pull.rs | 16 ++++++++-------- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/git.rs b/src/git.rs index b44390b..73d9446 100644 --- a/src/git.rs +++ b/src/git.rs @@ -632,7 +632,7 @@ fn validate_patch_applied(git_repo: &Repo, patch: &nostr::Event) -> Result<()> { None, None, ) - .context("cannot ammend commit to produce new oid")?; + .context("cannot amend commit to produce new oid")?; // replace the commit with the wrong oid with the newly created one with the // correct oid git_repo diff --git a/src/main.rs b/src/main.rs index f60edd8..9b9b660 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,7 +39,7 @@ enum Commands { Send(sub_commands::send::SubCommandArgs), /// list proposals; optionally apply them as a new branch List(sub_commands::list::SubCommandArgs), - /// send new commits as proposal ammendments + /// send new commits as proposal amendments Push, /// pull latest commits in proposal linked to checked out branch Pull, diff --git a/src/sub_commands/list.rs b/src/sub_commands/list.rs index 7f0622e..666c4bf 100644 --- a/src/sub_commands/list.rs +++ b/src/sub_commands/list.rs @@ -370,7 +370,7 @@ pub async fn launch(_cli_args: &Cli, _args: &SubCommandArgs) -> Result<()> { } // new proposal revision / rebase - // tip of local in proposal history (new, ammended or rebased version but no + // tip of local in proposal history (new, amended or rebased version but no // local changes) if commits_events.iter().any(|patch| { get_commit_id_from_patch(patch) @@ -477,21 +477,21 @@ pub async fn launch(_cli_args: &Cli, _args: &SubCommandArgs) -> Result<()> { }; } - println!("you have an ammended/rebase version the proposal that is unpublished"); - // user probably has a unpublished ammended or rebase version of the latest + println!("you have an amended/rebase version the proposal that is unpublished"); + // user probably has a unpublished amended or rebase version of the latest // proposal version // if tip of proposal commits exist (were once part of branch but have been - // ammended and git clean up job hasn't removed them) + // amended and git clean up job hasn't removed them) if git_repo.does_commit_exist(&proposal_tip.to_string())? { println!( - "you have previously applied the latest version of the proposal ({} ahead {} behind '{main_branch_name}') but your local proposal branch has ammended or rebased it ({} ahead {} behind '{main_branch_name}')", + "you have previously applied the latest version of the proposal ({} ahead {} behind '{main_branch_name}') but your local proposal branch has amended or rebased it ({} ahead {} behind '{main_branch_name}')", most_recent_proposal_patch_chain.len(), proposal_behind_main.len(), local_ahead_of_main.len(), local_beind_main.len(), ); } - // user probably has a unpublished ammended or rebase version of an older + // user probably has a unpublished amended or rebase version of an older // proposal version else { println!( @@ -503,7 +503,7 @@ pub async fn launch(_cli_args: &Cli, _args: &SubCommandArgs) -> Result<()> { ); println!( - "its likely that you have rebased / ammended an old proposal version because git has no record of the latest proposal commit." + "its likely that you have rebased / amended an old proposal version because git has no record of the latest proposal commit." ); println!( "it is possible that you have been working off the latest version and git has delete this commit as part of a clean up" diff --git a/src/sub_commands/pull.rs b/src/sub_commands/pull.rs index 5c8407e..9b74719 100644 --- a/src/sub_commands/pull.rs +++ b/src/sub_commands/pull.rs @@ -142,21 +142,21 @@ pub async fn launch() -> Result<()> { local_ahead_of_proposal.len() ); } else { - println!("you have an ammended/rebase version the proposal that is unpublished"); - // user probably has a unpublished ammended or rebase version of the latest + println!("you have an amended/rebase version the proposal that is unpublished"); + // user probably has a unpublished amended or rebase version of the latest // proposal version // if tip of proposal commits exist (were once part of branch but have been - // ammended and git clean up job hasn't removed them) + // amended and git clean up job hasn't removed them) if git_repo.does_commit_exist(&proposal_tip.to_string())? { println!( - "you have previously applied the latest version of the proposal ({} ahead {} behind '{main_branch_name}') but your local proposal branch has ammended or rebased it ({} ahead {} behind '{main_branch_name}')", + "you have previously applied the latest version of the proposal ({} ahead {} behind '{main_branch_name}') but your local proposal branch has amended or rebased it ({} ahead {} behind '{main_branch_name}')", most_recent_proposal_patch_chain.len(), proposal_behind_main.len(), local_ahead_of_main.len(), local_beind_main.len(), ); } - // user probably has a unpublished ammended or rebase version of an older + // user probably has a unpublished amended or rebase version of an older // proposal version else { println!( @@ -168,7 +168,7 @@ pub async fn launch() -> Result<()> { ); println!( - "its likely that you have rebased / ammended an old proposal version because git has no record of the latest proposal commit." + "its likely that you have rebased / amended an old proposal version because git has no record of the latest proposal commit." ); println!( "it is possible that you have been working off the latest version and git has delete this commit as part of a clean up" @@ -183,7 +183,7 @@ pub async fn launch() -> Result<()> { // TODO: this copy could be refined further based on this: // - amended commits in the proposal // - if local_base eq proposal base - // - ammended an older version of proposal + // - amended an older version of proposal // - if local_base is behind proposal_base // - rebased the proposal // - if local_base is ahead of proposal_base diff --git a/tests/list.rs b/tests/list.rs index 08c2e93..ff54586 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -1208,7 +1208,7 @@ mod when_main_branch_is_uptodate { } } - mod when_latest_proposal_ammended_locally { + mod when_latest_proposal_amended_locally { // other rebase scenarios should work if this test passes use super::*; async fn prep_and_run() -> Result<(GitTestRepo, GitTestRepo)> { @@ -1244,7 +1244,7 @@ mod when_main_branch_is_uptodate { "a", false, )?; - // simulating ammending the proposal + // simulating amending the proposal create_and_populate_branch( &test_repo, FEATURE_BRANCH_NAME_1, @@ -1333,7 +1333,7 @@ mod when_main_branch_is_uptodate { "a", false, )?; - // simulating ammending the proposal + // simulating amending the proposal create_and_populate_branch( &test_repo, FEATURE_BRANCH_NAME_1, @@ -1353,8 +1353,8 @@ mod when_main_branch_is_uptodate { )?; c.succeeds_with(0, true, None)?; p.expect("finding commits...\r\n")?; - p.expect("you have an ammended/rebase version the proposal that is unpublished\r\n")?; - p.expect("you have previously applied the latest version of the proposal (2 ahead 0 behind 'main') but your local proposal branch has ammended or rebased it (2 ahead 0 behind 'main')\r\n")?; + p.expect("you have an amended/rebase version the proposal that is unpublished\r\n")?; + p.expect("you have previously applied the latest version of the proposal (2 ahead 0 behind 'main') but your local proposal branch has amended or rebased it (2 ahead 0 behind 'main')\r\n")?; p.expect("to view the latest proposal but retain your changes:\r\n")?; p.expect(" 1) create a new branch off the tip commit of this one to store your changes\r\n")?; p.expect(" 2) run `ngit list` and checkout the latest published version of this proposal\r\n")?; diff --git a/tests/pull.rs b/tests/pull.rs index 102d9e2..ee8cad1 100644 --- a/tests/pull.rs +++ b/tests/pull.rs @@ -439,7 +439,7 @@ mod when_branch_is_checked_out { } } - mod when_old_proposal_revision_ammended_locally { + mod when_old_proposal_revision_amended_locally { use super::*; mod cli_prompts { @@ -467,7 +467,7 @@ mod when_branch_is_checked_out { let test_repo = GitTestRepo::default(); test_repo.populate()?; - // simulating ammending an older version of the proposal commits on the current + // simulating amending an older version of the proposal commits on the current // branch create_and_populate_branch( &test_repo, @@ -480,10 +480,10 @@ mod when_branch_is_checked_out { p.expect("finding proposal root event...\r\n")?; p.expect("found proposal root event. finding commits...\r\n")?; p.expect( - "you have an ammended/rebase version the proposal that is unpublished\r\n", + "you have an amended/rebase version the proposal that is unpublished\r\n", )?; p.expect("your local proposal branch (2 ahead 0 behind 'main') has conflicting changes with the latest published proposal (2 ahead 0 behind 'main')\r\n")?; - p.expect("its likely that you have rebased / ammended an old proposal version because git has no record of the latest proposal commit.\r\n")?; + p.expect("its likely that you have rebased / amended an old proposal version because git has no record of the latest proposal commit.\r\n")?; p.expect("it is possible that you have been working off the latest version and git has delete this commit as part of a clean up\r\n")?; p.expect("to view the latest proposal but retain your changes:\r\n")?; p.expect(" 1) create a new branch off the tip commit of this one to store your changes\r\n")?; @@ -519,7 +519,7 @@ mod when_branch_is_checked_out { } } - mod when_latest_proposal_ammended_locally { + mod when_latest_proposal_amended_locally { use super::*; mod cli_prompts { @@ -550,7 +550,7 @@ mod when_branch_is_checked_out { // simulating checking out the proposal (the commits_ids will match) create_and_populate_branch(&test_repo, "different-branch-name", "a", false)?; test_repo.checkout("main")?; - // simulating ammending the proposal + // simulating amending the proposal create_and_populate_branch( &test_repo, FEATURE_BRANCH_NAME_1, @@ -562,9 +562,9 @@ mod when_branch_is_checked_out { p.expect("finding proposal root event...\r\n")?; p.expect("found proposal root event. finding commits...\r\n")?; p.expect( - "you have an ammended/rebase version the proposal that is unpublished\r\n", + "you have an amended/rebase version the proposal that is unpublished\r\n", )?; - p.expect("you have previously applied the latest version of the proposal (2 ahead 0 behind 'main') but your local proposal branch has ammended or rebased it (2 ahead 0 behind 'main')\r\n")?; + p.expect("you have previously applied the latest version of the proposal (2 ahead 0 behind 'main') but your local proposal branch has amended or rebased it (2 ahead 0 behind 'main')\r\n")?; p.expect("to view the latest proposal but retain your changes:\r\n")?; p.expect(" 1) create a new branch off the tip commit of this one to store your changes\r\n")?; p.expect(" 2) run `ngit list` and checkout the latest published version of this proposal\r\n")?; -- cgit v1.2.3