upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-02-22 16:27:18 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-02-22 16:27:18 +0000
commit89c51886afd54afd901995916909ba98e764b23e (patch)
tree35e61b0984e24fca404b7cb7671402226859784c
parentb6f68cf782ee242f9390c6601a76a18367e2ab4d (diff)
refactor: fix spelling
ammended should read amended
-rw-r--r--src/git.rs2
-rw-r--r--src/main.rs2
-rw-r--r--src/sub_commands/list.rs14
-rw-r--r--src/sub_commands/pull.rs14
-rw-r--r--tests/list.rs10
-rw-r--r--tests/pull.rs16
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<()> {
632 None, 632 None,
633 None, 633 None,
634 ) 634 )
635 .context("cannot ammend commit to produce new oid")?; 635 .context("cannot amend commit to produce new oid")?;
636 // replace the commit with the wrong oid with the newly created one with the 636 // replace the commit with the wrong oid with the newly created one with the
637 // correct oid 637 // correct oid
638 git_repo 638 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 {
39 Send(sub_commands::send::SubCommandArgs), 39 Send(sub_commands::send::SubCommandArgs),
40 /// list proposals; optionally apply them as a new branch 40 /// list proposals; optionally apply them as a new branch
41 List(sub_commands::list::SubCommandArgs), 41 List(sub_commands::list::SubCommandArgs),
42 /// send new commits as proposal ammendments 42 /// send new commits as proposal amendments
43 Push, 43 Push,
44 /// pull latest commits in proposal linked to checked out branch 44 /// pull latest commits in proposal linked to checked out branch
45 Pull, 45 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<()> {
370 } 370 }
371 371
372 // new proposal revision / rebase 372 // new proposal revision / rebase
373 // tip of local in proposal history (new, ammended or rebased version but no 373 // tip of local in proposal history (new, amended or rebased version but no
374 // local changes) 374 // local changes)
375 if commits_events.iter().any(|patch| { 375 if commits_events.iter().any(|patch| {
376 get_commit_id_from_patch(patch) 376 get_commit_id_from_patch(patch)
@@ -477,21 +477,21 @@ pub async fn launch(_cli_args: &Cli, _args: &SubCommandArgs) -> Result<()> {
477 }; 477 };
478 } 478 }
479 479
480 println!("you have an ammended/rebase version the proposal that is unpublished"); 480 println!("you have an amended/rebase version the proposal that is unpublished");
481 // user probably has a unpublished ammended or rebase version of the latest 481 // user probably has a unpublished amended or rebase version of the latest
482 // proposal version 482 // proposal version
483 // if tip of proposal commits exist (were once part of branch but have been 483 // if tip of proposal commits exist (were once part of branch but have been
484 // ammended and git clean up job hasn't removed them) 484 // amended and git clean up job hasn't removed them)
485 if git_repo.does_commit_exist(&proposal_tip.to_string())? { 485 if git_repo.does_commit_exist(&proposal_tip.to_string())? {
486 println!( 486 println!(
487 "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}')", 487 "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}')",
488 most_recent_proposal_patch_chain.len(), 488 most_recent_proposal_patch_chain.len(),
489 proposal_behind_main.len(), 489 proposal_behind_main.len(),
490 local_ahead_of_main.len(), 490 local_ahead_of_main.len(),
491 local_beind_main.len(), 491 local_beind_main.len(),
492 ); 492 );
493 } 493 }
494 // user probably has a unpublished ammended or rebase version of an older 494 // user probably has a unpublished amended or rebase version of an older
495 // proposal version 495 // proposal version
496 else { 496 else {
497 println!( 497 println!(
@@ -503,7 +503,7 @@ pub async fn launch(_cli_args: &Cli, _args: &SubCommandArgs) -> Result<()> {
503 ); 503 );
504 504
505 println!( 505 println!(
506 "its likely that you have rebased / ammended an old proposal version because git has no record of the latest proposal commit." 506 "its likely that you have rebased / amended an old proposal version because git has no record of the latest proposal commit."
507 ); 507 );
508 println!( 508 println!(
509 "it is possible that you have been working off the latest version and git has delete this commit as part of a clean up" 509 "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<()> {
142 local_ahead_of_proposal.len() 142 local_ahead_of_proposal.len()
143 ); 143 );
144 } else { 144 } else {
145 println!("you have an ammended/rebase version the proposal that is unpublished"); 145 println!("you have an amended/rebase version the proposal that is unpublished");
146 // user probably has a unpublished ammended or rebase version of the latest 146 // user probably has a unpublished amended or rebase version of the latest
147 // proposal version 147 // proposal version
148 // if tip of proposal commits exist (were once part of branch but have been 148 // if tip of proposal commits exist (were once part of branch but have been
149 // ammended and git clean up job hasn't removed them) 149 // amended and git clean up job hasn't removed them)
150 if git_repo.does_commit_exist(&proposal_tip.to_string())? { 150 if git_repo.does_commit_exist(&proposal_tip.to_string())? {
151 println!( 151 println!(
152 "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}')", 152 "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}')",
153 most_recent_proposal_patch_chain.len(), 153 most_recent_proposal_patch_chain.len(),
154 proposal_behind_main.len(), 154 proposal_behind_main.len(),
155 local_ahead_of_main.len(), 155 local_ahead_of_main.len(),
156 local_beind_main.len(), 156 local_beind_main.len(),
157 ); 157 );
158 } 158 }
159 // user probably has a unpublished ammended or rebase version of an older 159 // user probably has a unpublished amended or rebase version of an older
160 // proposal version 160 // proposal version
161 else { 161 else {
162 println!( 162 println!(
@@ -168,7 +168,7 @@ pub async fn launch() -> Result<()> {
168 ); 168 );
169 169
170 println!( 170 println!(
171 "its likely that you have rebased / ammended an old proposal version because git has no record of the latest proposal commit." 171 "its likely that you have rebased / amended an old proposal version because git has no record of the latest proposal commit."
172 ); 172 );
173 println!( 173 println!(
174 "it is possible that you have been working off the latest version and git has delete this commit as part of a clean up" 174 "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<()> {
183 // TODO: this copy could be refined further based on this: 183 // TODO: this copy could be refined further based on this:
184 // - amended commits in the proposal 184 // - amended commits in the proposal
185 // - if local_base eq proposal base 185 // - if local_base eq proposal base
186 // - ammended an older version of proposal 186 // - amended an older version of proposal
187 // - if local_base is behind proposal_base 187 // - if local_base is behind proposal_base
188 // - rebased the proposal 188 // - rebased the proposal
189 // - if local_base is ahead of proposal_base 189 // - 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 {
1208 } 1208 }
1209 } 1209 }
1210 1210
1211 mod when_latest_proposal_ammended_locally { 1211 mod when_latest_proposal_amended_locally {
1212 // other rebase scenarios should work if this test passes 1212 // other rebase scenarios should work if this test passes
1213 use super::*; 1213 use super::*;
1214 async fn prep_and_run() -> Result<(GitTestRepo, GitTestRepo)> { 1214 async fn prep_and_run() -> Result<(GitTestRepo, GitTestRepo)> {
@@ -1244,7 +1244,7 @@ mod when_main_branch_is_uptodate {
1244 "a", 1244 "a",
1245 false, 1245 false,
1246 )?; 1246 )?;
1247 // simulating ammending the proposal 1247 // simulating amending the proposal
1248 create_and_populate_branch( 1248 create_and_populate_branch(
1249 &test_repo, 1249 &test_repo,
1250 FEATURE_BRANCH_NAME_1, 1250 FEATURE_BRANCH_NAME_1,
@@ -1333,7 +1333,7 @@ mod when_main_branch_is_uptodate {
1333 "a", 1333 "a",
1334 false, 1334 false,
1335 )?; 1335 )?;
1336 // simulating ammending the proposal 1336 // simulating amending the proposal
1337 create_and_populate_branch( 1337 create_and_populate_branch(
1338 &test_repo, 1338 &test_repo,
1339 FEATURE_BRANCH_NAME_1, 1339 FEATURE_BRANCH_NAME_1,
@@ -1353,8 +1353,8 @@ mod when_main_branch_is_uptodate {
1353 )?; 1353 )?;
1354 c.succeeds_with(0, true, None)?; 1354 c.succeeds_with(0, true, None)?;
1355 p.expect("finding commits...\r\n")?; 1355 p.expect("finding commits...\r\n")?;
1356 p.expect("you have an ammended/rebase version the proposal that is unpublished\r\n")?; 1356 p.expect("you have an amended/rebase version the proposal that is unpublished\r\n")?;
1357 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")?; 1357 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")?;
1358 p.expect("to view the latest proposal but retain your changes:\r\n")?; 1358 p.expect("to view the latest proposal but retain your changes:\r\n")?;
1359 p.expect(" 1) create a new branch off the tip commit of this one to store your changes\r\n")?; 1359 p.expect(" 1) create a new branch off the tip commit of this one to store your changes\r\n")?;
1360 p.expect(" 2) run `ngit list` and checkout the latest published version of this proposal\r\n")?; 1360 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 {
439 } 439 }
440 } 440 }
441 441
442 mod when_old_proposal_revision_ammended_locally { 442 mod when_old_proposal_revision_amended_locally {
443 use super::*; 443 use super::*;
444 444
445 mod cli_prompts { 445 mod cli_prompts {
@@ -467,7 +467,7 @@ mod when_branch_is_checked_out {
467 let test_repo = GitTestRepo::default(); 467 let test_repo = GitTestRepo::default();
468 test_repo.populate()?; 468 test_repo.populate()?;
469 469
470 // simulating ammending an older version of the proposal commits on the current 470 // simulating amending an older version of the proposal commits on the current
471 // branch 471 // branch
472 create_and_populate_branch( 472 create_and_populate_branch(
473 &test_repo, 473 &test_repo,
@@ -480,10 +480,10 @@ mod when_branch_is_checked_out {
480 p.expect("finding proposal root event...\r\n")?; 480 p.expect("finding proposal root event...\r\n")?;
481 p.expect("found proposal root event. finding commits...\r\n")?; 481 p.expect("found proposal root event. finding commits...\r\n")?;
482 p.expect( 482 p.expect(
483 "you have an ammended/rebase version the proposal that is unpublished\r\n", 483 "you have an amended/rebase version the proposal that is unpublished\r\n",
484 )?; 484 )?;
485 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")?; 485 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")?;
486 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")?; 486 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")?;
487 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")?; 487 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")?;
488 p.expect("to view the latest proposal but retain your changes:\r\n")?; 488 p.expect("to view the latest proposal but retain your changes:\r\n")?;
489 p.expect(" 1) create a new branch off the tip commit of this one to store your changes\r\n")?; 489 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 {
519 } 519 }
520 } 520 }
521 521
522 mod when_latest_proposal_ammended_locally { 522 mod when_latest_proposal_amended_locally {
523 use super::*; 523 use super::*;
524 524
525 mod cli_prompts { 525 mod cli_prompts {
@@ -550,7 +550,7 @@ mod when_branch_is_checked_out {
550 // simulating checking out the proposal (the commits_ids will match) 550 // simulating checking out the proposal (the commits_ids will match)
551 create_and_populate_branch(&test_repo, "different-branch-name", "a", false)?; 551 create_and_populate_branch(&test_repo, "different-branch-name", "a", false)?;
552 test_repo.checkout("main")?; 552 test_repo.checkout("main")?;
553 // simulating ammending the proposal 553 // simulating amending the proposal
554 create_and_populate_branch( 554 create_and_populate_branch(
555 &test_repo, 555 &test_repo,
556 FEATURE_BRANCH_NAME_1, 556 FEATURE_BRANCH_NAME_1,
@@ -562,9 +562,9 @@ mod when_branch_is_checked_out {
562 p.expect("finding proposal root event...\r\n")?; 562 p.expect("finding proposal root event...\r\n")?;
563 p.expect("found proposal root event. finding commits...\r\n")?; 563 p.expect("found proposal root event. finding commits...\r\n")?;
564 p.expect( 564 p.expect(
565 "you have an ammended/rebase version the proposal that is unpublished\r\n", 565 "you have an amended/rebase version the proposal that is unpublished\r\n",
566 )?; 566 )?;
567 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")?; 567 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")?;
568 p.expect("to view the latest proposal but retain your changes:\r\n")?; 568 p.expect("to view the latest proposal but retain your changes:\r\n")?;
569 p.expect(" 1) create a new branch off the tip commit of this one to store your changes\r\n")?; 569 p.expect(" 1) create a new branch off the tip commit of this one to store your changes\r\n")?;
570 p.expect(" 2) run `ngit list` and checkout the latest published version of this proposal\r\n")?; 570 p.expect(" 2) run `ngit list` and checkout the latest published version of this proposal\r\n")?;