[M] Rebrand

This commit is contained in:
2026-05-08 05:34:08 +00:00
parent ebeb045c51
commit 9a9cbba767
14 changed files with 102 additions and 99 deletions
+6 -4
View File
@@ -7,6 +7,8 @@ use anyhow::{Context, Result, anyhow, bail};
use directories::ProjectDirs;
use serde::{Deserialize, Serialize};
const APP_NAME: &str = "refray";
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Config {
#[serde(default)]
@@ -223,15 +225,15 @@ impl EndpointConfig {
}
pub fn default_config_path() -> PathBuf {
ProjectDirs::from("dev", "git-sync", "git-sync")
ProjectDirs::from("dev", APP_NAME, APP_NAME)
.map(|dirs| dirs.config_dir().join("config.toml"))
.unwrap_or_else(|| PathBuf::from("git-sync.toml"))
.unwrap_or_else(|| PathBuf::from("refray.toml"))
}
pub fn default_work_dir() -> PathBuf {
ProjectDirs::from("dev", "git-sync", "git-sync")
ProjectDirs::from("dev", APP_NAME, APP_NAME)
.map(|dirs| dirs.cache_dir().join("mirrors"))
.unwrap_or_else(|| PathBuf::from(".git-sync-cache"))
.unwrap_or_else(|| PathBuf::from(".refray-cache"))
}
fn trim_end(value: &str) -> &str {
+2 -2
View File
@@ -649,9 +649,9 @@ impl GitMirror {
"-C",
worktree.to_str().unwrap(),
"-c",
"user.name=git-sync",
"user.name=refray",
"-c",
"user.email=git-sync@example.invalid",
"user.email=refray@example.invalid",
]
.into_iter()
.chain(args),
+7 -7
View File
@@ -43,11 +43,11 @@ pub fn run_config_wizard(path: &Path) -> Result<()> {
let theme = ColorfulTheme::default();
println!();
println!("{}", style("git-sync configuration wizard").cyan().bold());
println!("{}", style("refray configuration wizard").cyan().bold());
let description = if existing_config {
"Review, add, edit, or delete sync groups."
} else {
"Enter profile or organization URLs, then git-sync will build the mirror group."
"Enter profile or organization URLs, then refray will build the mirror group."
};
println!("{}", style(description).dim());
println!();
@@ -214,7 +214,7 @@ fn prompt_webhook_setup_styled(config: &mut Config, theme: &ColorfulTheme) -> Re
style(DEFAULT_WEBHOOK_LISTEN).bold()
);
println!(
" {} If git-sync serve is already running there, you can continue.",
" {} If refray serve is already running there, you can continue.",
style("-").yellow()
);
None
@@ -280,7 +280,7 @@ fn print_webhook_url_instructions() {
println!(
" {} Start the receiver with: {}",
style("-").cyan(),
style(format!("git-sync serve --listen {DEFAULT_WEBHOOK_LISTEN}")).bold()
style(format!("refray serve --listen {DEFAULT_WEBHOOK_LISTEN}")).bold()
);
println!(
" {} The receiver accepts: {} and {}",
@@ -360,7 +360,7 @@ fn respond_demo_webhook_request(request: Request) {
let (status, body) = if path == "/" || path == "/webhook" {
(
StatusCode(200),
"git-sync webhook setup listener\nThis temporary server only confirms that your public URL reaches this machine.\nAfter saving config, run git-sync serve for real webhooks.\n",
"refray webhook setup listener\nThis temporary server only confirms that your public URL reaches this machine.\nAfter saving config, run refray serve for real webhooks.\n",
)
} else {
(StatusCode(404), "not found\n")
@@ -706,7 +706,7 @@ fn prompt_conflict_resolution_styled(
];
let default = existing.map(conflict_resolution_index).unwrap_or(3);
let index = Select::with_theme(theme)
.with_prompt("How should git-sync resolve branch conflicts?")
.with_prompt("How should refray resolve branch conflicts?")
.items(options)
.default(default)
.interact()?;
@@ -1136,7 +1136,7 @@ fn token_creation_url(provider: &ProviderKind, base_url: &str) -> String {
ProviderKind::Github => format!("{base}/settings/tokens"),
ProviderKind::Gitlab => {
format!(
"{base}/-/user_settings/personal_access_tokens?name=git-sync&scopes=api,write_repository"
"{base}/-/user_settings/personal_access_tokens?name=refray&scopes=api,write_repository"
)
}
ProviderKind::Gitea => format!("{base}/user/settings/applications"),
+1 -1
View File
@@ -21,7 +21,7 @@ use crate::webhook::{
};
#[derive(Parser, Debug)]
#[command(name = "git-sync")]
#[command(name = "refray")]
#[command(about = "Mirror repositories between Git hosting providers")]
struct Cli {
#[arg(long, global = true, value_name = "PATH")]
+1 -1
View File
@@ -848,7 +848,7 @@ impl<'a> ProviderClient<'a> {
request: reqwest::blocking::RequestBuilder,
) -> Result<reqwest::blocking::RequestBuilder> {
let mut headers = HeaderMap::new();
headers.insert(USER_AGENT, HeaderValue::from_static("git-sync/0.1"));
headers.insert(USER_AGENT, HeaderValue::from_static("refray/0.1"));
headers.insert(ACCEPT, HeaderValue::from_static("application/json"));
match self.site.provider {
ProviderKind::Github => {
+3 -3
View File
@@ -35,7 +35,7 @@ use self::state::{
};
pub const DEFAULT_JOBS: usize = 4;
const CONFLICT_BRANCH_ROOT: &str = "git-sync/conflicts/";
const CONFLICT_BRANCH_ROOT: &str = "refray/conflicts/";
#[derive(Clone, Debug)]
pub struct SyncOptions {
@@ -1018,11 +1018,11 @@ fn open_conflict_pull_requests(
};
mirror_repo.push_branch_updates(remotes, &[update])?;
let title = format!(
"Resolve git-sync conflict: {} from {}",
"Resolve refray conflict: {} from {}",
conflict.branch, source_remote
);
let body = format!(
"git-sync detected divergent branch tips and opened this pull request to merge {}@{} into {}@{}.",
"refray detected divergent branch tips and opened this pull request to merge {}@{} into {}@{}.",
source_remote,
short_sha(source_sha),
target_remote,