From 4961e2d4c14e50bfc6685c69681d3f2cc9294360 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 18 Aug 2025 10:25:26 +0100 Subject: feat(sync): add `ref-name` param to limit sync limit syncing to a single reference with this new parameter. change instructions for out of sync remotes to use sync with this new option. --- src/bin/git_remote_nostr/push.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/bin/git_remote_nostr/push.rs') diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs index 1738790..80aed22 100644 --- a/src/bin/git_remote_nostr/push.rs +++ b/src/bin/git_remote_nostr/push.rs @@ -601,7 +601,7 @@ fn create_rejected_refspecs_and_remotes_refspecs( .or_insert(vec![url.to_string()]); term.write_line( format!( - "ERROR: {short_name} {to} conflicts with nostr ({} ahead {} behind) and local ({} ahead {} behind). either:\r\n 1. pull from that git server and resolve\r\n 2. force push your branch to the git server before pushing to nostr remote", + "ERROR: {short_name} {to} conflicts with nostr ({} ahead {} behind) and local ({} ahead {} behind). someone else may have pushed new updates. options:\r\n 1. review and integrate remote's tip available via `git checkout {remote_value}` \r\n 2. align remote state with nostr via `ngit sync --ref-name {to} --force` and try to push again", ahead_of_nostr.len(), behind_nostr.len(), ahead_of_local.len(), @@ -622,7 +622,7 @@ fn create_rejected_refspecs_and_remotes_refspecs( .and_modify(|a| a.push(url.to_string())) .or_insert(vec![url.to_string()]); term.write_line( - format!("ERROR: {short_name} {to} conflicts with nostr and is not an ancestor of local branch. either:\r\n 1. pull from that git server and resolve\r\n 2. force push your branch to the git server before pushing to nostr remote").as_str(), + format!("ERROR: {short_name} {to} conflicts with nostr and is not an ancestor of local branch. someone else may have pushed new updates. options:\r\n 1. review and integrate remote's tip available via `git checkout {remote_value}` \r\n 2. align remote state with nostr via `ngit sync --ref-name {to} --force` and try to push again").as_str(), )?; } } else { @@ -655,7 +655,7 @@ fn create_rejected_refspecs_and_remotes_refspecs( .or_insert(vec![url.to_string()]); term.write_line( format!( - "ERROR: {short_name} already contains {to} {} ahead and {} behind local branch. either:\r\n 1. pull from that git server and resolve\r\n 2. force push your branch to the git server before pushing to nostr remote", + "ERROR: {short_name} already contains {to} {} ahead and {} behind local branch. someone else may have pushed new updates. options:\r\n 1. review and integrate remote's tip available via `git checkout {remote_value}` \r\n 2. align remote state with nostr via `ngit sync --ref-name {to} --force` and try to push again", ahead.len(), behind.len(), ).as_str(), @@ -672,7 +672,7 @@ fn create_rejected_refspecs_and_remotes_refspecs( .and_modify(|a| a.push(url.to_string())) .or_insert(vec![url.to_string()]); term.write_line( - format!("ERROR: {short_name} already contains {to} at {remote_value} which is not an ancestor of local branch. either:\r\n 1. pull from that git server and resolve\r\n 2. force push your branch to the git server before pushing to nostr remote").as_str(), + format!("ERROR: {short_name} already contains {to} at {remote_value} which is not an ancestor of local branch. someone else may have pushed new updates. options:\r\n 1. review and integrate remote's tip available via `git checkout {remote_value}` \r\n 2. align remote state with nostr via `ngit sync --ref-name {to} --force` and try to push again").as_str(), )?; } } else { -- cgit v1.2.3