Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) fn execute_git_clone(
let mut recursive = options.recursive;
let mut parallel = 4_usize;
let mut depth: Option<String> = options.depth.map(|d| d.to_string());
let mut meta_depth: Option<usize> = None; // Limit recursion depth for nested .meta files
let mut meta_depth: Option<usize> = None; // Limit recursion depth for nested .meta.yaml files

let mut url = String::new();
let mut dir_arg: Option<String> = None;
Expand Down Expand Up @@ -112,7 +112,7 @@ pub(crate) fn execute_git_clone(

if dry_run {
// Output what we know - just the meta repo clone command
// (Child repos are in .meta file which hasn't been cloned yet)
// (Child repos are in .meta.yaml file which hasn't been cloned yet)
println!("{} Would clone meta repository:", style("[DRY RUN]").cyan());
println!(" {}", meta_core::display::escape(&clone_cmd_str));
return Ok(CommandResult::Message(String::new()));
Expand Down Expand Up @@ -148,7 +148,7 @@ pub(crate) fn execute_git_clone(
let clone_dir_path = cwd.join(&clone_dir);
if config::find_meta_config_in(&clone_dir_path)?.is_none() {
return Ok(CommandResult::Message(
"No .meta config found in cloned repository".to_string(),
"No .meta.yaml found in cloned repository".to_string(),
));
}

Expand Down Expand Up @@ -200,7 +200,7 @@ pub(crate) fn execute_git_clone(
let (completed, total) = queue.get_counts();
if total > initial_count {
println!(
"Meta-repo clone completed ({} repos cloned, {} discovered via nested .meta files)",
"Meta-repo clone completed ({} repos cloned, {} discovered via nested .meta.yaml files)",
completed,
total - initial_count
);
Expand Down
12 changes: 6 additions & 6 deletions src/clone_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub(crate) fn clone_with_queue(
let work_signal = Arc::new((Mutex::new(false), Condvar::new()));

let ssh_cmd = Arc::new(ssh_cmd.map(|s| s.to_string()));
// Nested .meta configs that failed to parse or validate
// Nested .meta.yaml files that failed to parse or validate
let nested_errors = Arc::new(Mutex::new(Vec::new()));

// Spawn worker threads
Expand Down Expand Up @@ -116,7 +116,7 @@ pub(crate) fn clone_with_queue(
.map(|summary| format!("\n{summary}"))
.unwrap_or_default();
anyhow::bail!(
"Could not read nested .meta configs:\n{}{failed}",
"Could not read nested .meta.yaml files:\n{}{failed}",
errors.join("\n")
);
}
Expand Down Expand Up @@ -154,7 +154,7 @@ pub(crate) fn report_failures(queue: &CloneQueue) -> Option<String> {
))
}

/// Clone a single repository and handle .meta discovery
/// Clone a single repository and handle .meta.yaml discovery
fn clone_single_repo(
task: &CloneTask,
queue: &Arc<CloneQueue>,
Expand All @@ -180,10 +180,10 @@ fn clone_single_repo(
"{}",
style(format!("Skipped {} (exists)", task.name)).yellow()
));
// Still mark as completed and check for nested .meta
// Still mark as completed and check for nested .meta.yaml
if let Err(e) = queue.mark_completed(task) {
debug!(
"Failed to check nested .meta for {}: {}",
"Failed to check nested .meta.yaml for {}: {}",
task.name,
meta_core::display::escape_lines(&format!("{e:#}"))
);
Expand Down Expand Up @@ -221,7 +221,7 @@ fn clone_single_repo(
let status = child.wait();
match status {
Ok(status) if status.success() => {
// Check for nested .meta and report new discoveries
// Check for nested .meta.yaml and report new discoveries
match queue.mark_completed(task) {
Ok(added) if added > 0 => {
let (_, total) = queue.get_counts();
Expand Down
6 changes: 3 additions & 3 deletions src/commands/worktree/cli_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct CreateArgs {
#[arg(long = "repo", value_name = "ALIAS[:BRANCH]")]
pub repos: Vec<RepoSpec>,

/// Add all repos from .meta config
/// Add all repos from .meta.yaml
#[arg(long, conflicts_with = "repos")]
pub all: bool,

Expand Down Expand Up @@ -96,9 +96,9 @@ pub struct CreateArgs {

/// Resolve dependencies across the full nested meta tree
///
/// By default, dependencies are resolved from the current .meta level.
/// By default, dependencies are resolved from the current .meta.yaml level.
/// With --recursive, walks up to the root meta directory and resolves
/// dependencies across all nested .meta workspaces. Repo aliases
/// dependencies across all nested .meta.yaml workspaces. Repo aliases
/// use full paths from root (e.g., open-source/gitkb/core).
#[arg(long, short = 'r')]
pub recursive: bool,
Expand Down
4 changes: 2 additions & 2 deletions src/commands/worktree/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub(crate) fn handle_create(
);
}

// Parse .meta to get project list
// Parse .meta.yaml to get project list
// When --all is specified, include root repo "." if it's a git repository
let projects = meta_git_lib::worktree::helpers::load_projects_with_root(&meta_dir, use_all)?;

Expand Down Expand Up @@ -831,7 +831,7 @@ fn build_nested_dep_graph(meta_dir: &std::path::Path) -> Result<DependencyGraph>
/// The source of the project at `place` from `meta_dir`, reading only the
/// configs of the meta repos on the way to it.
fn project_at(meta_dir: &std::path::Path, place: &str) -> Result<Option<std::path::PathBuf>> {
let Some((config, _)) = meta_core::config::find_meta_config_in(meta_dir)? else {
let Some(config) = meta_core::config::find_meta_config_in(meta_dir)? else {
return Ok(None);
};
let (projects, _) = meta_core::config::parse_meta_config(&config)?;
Expand Down
2 changes: 1 addition & 1 deletion src/commands/worktree/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn build_loop_config(
} else {
let paths: Vec<PathBuf> = repos.iter().map(|r| r.path.clone()).collect();
match meta_cli::worktree::set_config(wt_dir, &paths, None)? {
Some((config, _)) => {
Some(config) => {
let (projects, _) = meta_core::config::parse_meta_config(&config)?;
let tree = meta_cli::worktree::set_tree(wt_dir, &paths, &projects)?;
repo_filter::repo_names(wt_dir, &projects, &tree)
Expand Down
2 changes: 1 addition & 1 deletion src/commands/worktree/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub(crate) fn handle_list(
.to_path_buf(),
_ => {
let meta_dir = meta_cli::config::find_meta_config(&cwd, None)?
.and_then(|(path, _)| path.parent().map(std::path::Path::to_path_buf));
.and_then(|path| path.parent().map(std::path::Path::to_path_buf));
let root = resolve_worktree_root(Some(meta_dir.as_deref().unwrap_or(&cwd)))?;
if root.is_absolute() {
root
Expand Down
2 changes: 1 addition & 1 deletion src/commands/worktree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fn write_worktree_help(w: &mut dyn std::io::Write) {
let _ = writeln!(w, " --repo <ALIAS[:BRANCH]> Add specific repo(s)");
let _ = writeln!(
w,
" --all Add all repos from .meta config"
" --all Add all repos from .meta.yaml"
);
let _ = writeln!(w, " --branch <NAME> Override default branch name");
let _ = writeln!(
Expand Down
4 changes: 2 additions & 2 deletions src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ pub(crate) fn execute_git_commit(
projects.to_vec()
} else {
// Fall back to reading local meta config
let Some((meta_path, _format)) = config::find_meta_config_in(cwd)? else {
let Some(meta_path) = config::find_meta_config_in(cwd)? else {
return Ok(CommandResult::Message(format!(
"No .meta config found in {}",
"No .meta.yaml found in {}",
escape_path(cwd)
)));
};
Expand Down
6 changes: 3 additions & 3 deletions src/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use meta_core::config;
use std::path::Path;

/// Get project directories - uses passed-in list if non-empty, otherwise reads local .meta
/// Get project directories - uses passed-in list if non-empty, otherwise reads local .meta.yaml
pub(crate) fn get_project_directories_with_fallback(
projects: &[String],
cwd: &Path,
Expand All @@ -10,13 +10,13 @@ pub(crate) fn get_project_directories_with_fallback(
// Use the projects list from meta_cli (supports --recursive)
Ok(projects.to_vec())
} else {
// Fall back to reading local .meta file
// Fall back to reading local .meta.yaml file
get_project_directories(cwd)
}
}

pub(crate) fn get_project_directories(cwd: &Path) -> anyhow::Result<Vec<String>> {
// Without a .meta there is only the root; a .meta that is refused is an
// Without a .meta.yaml there is only the root; a .meta.yaml that is refused is an
// error, not a reason to act on the root alone
if config::find_meta_config(cwd, None)?.is_none() {
return Ok(vec![".".to_string()]);
Expand Down
28 changes: 14 additions & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ use helpers::get_project_directories_with_fallback;
/// Execute a command for meta repositories.
///
/// The `projects` parameter is the list of project directories passed from meta_cli.
/// When meta_cli runs with `--recursive`, it discovers nested .meta files and passes
/// When meta_cli runs with `--recursive`, it discovers nested .meta.yaml files and passes
/// all project directories here. If `projects` is empty, we fall back to reading
/// the local .meta file via `get_project_directories()`.
/// the local .meta.yaml file via `get_project_directories()`.
pub fn execute_command(
command: &str,
args: &[String],
Expand Down Expand Up @@ -68,7 +68,7 @@ pub fn execute_command(
if options.include_filters.is_some() || options.exclude_filters.is_some() =>
{
Err(anyhow::anyhow!(
"meta {command} finds its repos itself (in the .meta files); it does not take --include/--exclude"
"meta {command} finds its repos itself (in the .meta.yaml files); it does not take --include/--exclude"
))
}
"git status" => status::execute_git_status(projects, options, cwd),
Expand Down Expand Up @@ -167,8 +167,8 @@ Meta options:\n\
--dry-run Show the command that would run in each repo\n\
--recursive Include repos from nested meta workspaces\n\
--depth <N> Limit recursive traversal depth\n\
--include <REPOS> Only these repos (.meta name or path from the root)\n\
--exclude <REPOS> Skip these repos (.meta name or path from the root)\n\
--include <REPOS> Only these repos (.meta.yaml name or path from the root)\n\
--exclude <REPOS> Skip these repos (.meta.yaml name or path from the root)\n\
--tag <TAGS> Filter by project tag(s), comma-separated\n\
--parallel Run repo commands concurrently\n\
--sequential Run repo commands one at a time\n\n\
Expand Down Expand Up @@ -348,7 +348,7 @@ mod tests {
#[test]
fn test_meta_config_parsing() {
let dir = tempfile::tempdir().unwrap();
let meta_path = dir.path().join(".meta");
let meta_path = dir.path().join(".meta.yaml");
std::fs::write(
&meta_path,
r#"{"projects": {"foo": "git@github.com:org/foo.git", "bar": "git@github.com:org/bar.git"}}"#,
Expand Down Expand Up @@ -743,7 +743,7 @@ the only commit message

let dirs = get_project_directories(temp_dir.path()).unwrap();

// Should return just "." when no .meta file
// Should return just "." when no .meta.yaml file
assert_eq!(dirs, vec!["."]);
}

Expand All @@ -752,7 +752,7 @@ the only commit message
// A refused config is an error, not "just the root"
let temp_dir = TempDir::new().unwrap();
std::fs::write(
temp_dir.path().join(".meta"),
temp_dir.path().join(".meta.yaml"),
r#"{"projects": {"evil": {"repo": "u", "path": "../../x"}}}"#,
)
.unwrap();
Expand All @@ -768,9 +768,9 @@ the only commit message
fn test_get_project_directories_with_meta_file() {
let temp_dir = TempDir::new().unwrap();

// Create .meta file
// Create .meta.yaml file
let meta_content = r#"{"projects": {"alpha": "url1", "beta": "url2", "gamma": "url3"}}"#;
std::fs::write(temp_dir.path().join(".meta"), meta_content).unwrap();
std::fs::write(temp_dir.path().join(".meta.yaml"), meta_content).unwrap();

let dirs = get_project_directories(temp_dir.path()).unwrap();

Expand All @@ -786,9 +786,9 @@ the only commit message
fn test_get_project_directories_sorted() {
let temp_dir = TempDir::new().unwrap();

// Create .meta file with unsorted projects
// Create .meta.yaml file with unsorted projects
let meta_content = r#"{"projects": {"zebra": "url1", "alpha": "url2", "middle": "url3"}}"#;
std::fs::write(temp_dir.path().join(".meta"), meta_content).unwrap();
std::fs::write(temp_dir.path().join(".meta.yaml"), meta_content).unwrap();

let dirs = get_project_directories(temp_dir.path()).unwrap();

Expand All @@ -802,9 +802,9 @@ the only commit message
fn test_get_project_directories_empty_projects() {
let temp_dir = TempDir::new().unwrap();

// Create .meta file with no projects
// Create .meta.yaml file with no projects
let meta_content = r#"{"projects": {}}"#;
std::fs::write(temp_dir.path().join(".meta"), meta_content).unwrap();
std::fs::write(temp_dir.path().join(".meta.yaml"), meta_content).unwrap();

let dirs = get_project_directories(temp_dir.path()).unwrap();

Expand Down
12 changes: 6 additions & 6 deletions src/ssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ use meta_core::display::escape;
use std::collections::BTreeSet;
use std::path::Path;

/// Discover unique SSH remote URLs from the .meta config in the current directory.
/// Discover unique SSH remote URLs from the .meta.yaml in the current directory.
/// Returns the full SSH URLs (preserving user, host, and port) so callers can
/// pass them directly to `establish_ssh_masters` without information loss.
/// Returns an empty list if no .meta config is found or no SSH URLs exist.
/// Returns an empty list if no .meta.yaml is found or no SSH URLs exist.
pub fn discover_ssh_urls(cwd: &Path) -> Vec<String> {
let Ok(Some((config_path, _format))) = meta_core::config::find_meta_config(cwd, None) else {
let Ok(Some(config_path)) = meta_core::config::find_meta_config(cwd, None) else {
return vec![];
};

Expand All @@ -26,7 +26,7 @@ pub fn discover_ssh_urls(cwd: &Path) -> Vec<String> {
urls.into_iter().collect()
}

/// A remote URL mismatch between .meta config and the actual repo.
/// A remote URL mismatch between .meta.yaml and the actual repo.
pub(crate) struct RemoteMismatch {
pub name: String,
/// The configured path (may differ from name for custom paths / nested repos).
Expand All @@ -35,10 +35,10 @@ pub(crate) struct RemoteMismatch {
pub actual: String,
}

/// Check child repos for remote URL mismatches against .meta config.
/// Check child repos for remote URL mismatches against .meta.yaml.
/// Returns a list of mismatches found (non-interactive, no prompts).
pub(crate) fn find_remote_mismatches(cwd: &Path) -> Vec<RemoteMismatch> {
let Ok(Some((config_path, _format))) = meta_core::config::find_meta_config(cwd, None) else {
let Ok(Some(config_path)) = meta_core::config::find_meta_config(cwd, None) else {
return vec![];
};

Expand Down
2 changes: 1 addition & 1 deletion src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) fn execute_git_status(
cwd: &Path,
) -> anyhow::Result<CommandResult> {
// Return an execution plan - let loop_lib handle execution, dry-run, and JSON output
// Use projects from meta_cli if available (enables --recursive), otherwise read local .meta
// Use projects from meta_cli if available (enables --recursive), otherwise read local .meta.yaml
let dirs = get_project_directories_with_fallback(projects, cwd)?;

// Set git-specific environment variables (pager, colors, prompts)
Expand Down
16 changes: 8 additions & 8 deletions src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ pub(crate) fn execute_git_update(
// Determine if we're in recursive mode (projects list provided by meta_cli)
let recursive = !projects.is_empty();

// Build list of directories to check for .meta files
// Build list of directories to check for .meta.yaml files
let dirs_to_check: Vec<PathBuf> = if recursive {
// In recursive mode, check each directory that has a .meta file
// A .meta that can't be examined is an error, not "no nested repos"
// In recursive mode, check each directory that has a .meta.yaml file
// A .meta.yaml that can't be examined is an error, not "no nested repos"
let mut dirs = Vec::new();
for p in projects {
let path = if p == "." {
Expand All @@ -46,7 +46,7 @@ pub(crate) fn execute_git_update(

// First pass: check for orphaned repos and warn user
for dir in &dirs_to_check {
let Some((meta_path, _format)) = config::find_meta_config_in(dir)? else {
let Some(meta_path) = config::find_meta_config_in(dir)? else {
continue;
};

Expand All @@ -55,7 +55,7 @@ pub(crate) fn execute_git_update(
Err(_) => continue,
};

// Check for orphaned repositories (exist locally but not in .meta)
// Check for orphaned repositories (exist locally but not in .meta.yaml)
let config_projects: HashSet<String> = projects.iter().map(|p| p.path.clone()).collect();
if let Ok(entries) = std::fs::read_dir(dir) {
for entry in entries.flatten() {
Expand All @@ -74,7 +74,7 @@ pub(crate) fn execute_git_update(
};
let shown = escape(&relative_path);
eprintln!(
"{} {} exists locally but is not in .meta. To remove: rm -rf {}",
"{} {} exists locally but is not in .meta.yaml. To remove: rm -rf {}",
style("⚠").yellow(),
style(&shown).yellow().bold(),
shown
Expand All @@ -89,7 +89,7 @@ pub(crate) fn execute_git_update(
let meta_depth = if recursive { None } else { Some(0) };
let queue = Arc::new(CloneQueue::new(None, meta_depth)); // No git depth for update

// Seed the queue from all known .meta files
// Seed the queue from all known .meta.yaml files
for dir in &dirs_to_check {
// Determine relative depth based on whether it's the cwd or nested
let depth_level = if dir.as_path() == cwd { 0 } else { 1 };
Expand Down Expand Up @@ -154,7 +154,7 @@ pub(crate) fn execute_git_update(
let (completed, total) = queue.get_counts();
if total > initial_count {
println!(
"Update completed ({} repos cloned, {} discovered via nested .meta files)",
"Update completed ({} repos cloned, {} discovered via nested .meta.yaml files)",
completed,
total - initial_count
);
Expand Down
Loading
Loading