{"record":{"id":"53ceed87d0d07879","repo":"GitoxideLabs/gitoxide","slug":"path-display-does-not-name-a-file","errorCode":null,"errorMessage":"path {display:?} does not name a file","messagePattern":"path (.+?) does not name a file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/command.rs","lineNumber":662,"sourceCode":"                .context(\"could not load HEAD's first parent\")?\n                .tree()\n                .context(\"could not load HEAD's first-parent tree\")?,\n        ),\n        None => None,\n    };\n    let changes = crate::load_tree_changes_without_lines(repository, old_tree.as_ref(), &new_tree, None)?;\n    let mut seen = HashSet::new();\n    let mut selected = Vec::with_capacity(paths.len());\n    for path in paths {\n        let display = path.to_string_lossy();\n        let path = gix::path::os_str_into_bstr(path)\n            .with_context(|| format!(\"path {display:?} could not be converted to a Git path\"))?;\n        let path = repository\n            .normalize_path(path)\n            .with_context(|| format!(\"could not normalize path {display:?}\"))?\n            .into_owned();\n        if path.is_empty() {\n            anyhow::bail!(\"path {display:?} does not name a file\");\n        }\n        if !seen.insert(path.clone()) {\n            continue;\n        }\n        let change = changes\n            .paths\n            .iter()\n            .find(|change| change.path == path)\n            .with_context(|| format!(\"path {display:?} is not changed by HEAD\"))?;\n        selected.push(change.clone());\n    }\n    Ok(Some(selected))\n}\n\nfn split(repository: gix::Repository, graph: &crate::history::HistoryGraph, args: Split) -> Result<()> {\n    let repository_path = repository.git_dir().to_owned();\n    let bare = repository.is_bare();\n    let mut prepared = crate::edit::split::prepare(repository, args.todo)?;","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/command.rs#L644-L680","documentation":"`gix_tix::command::resolve_spill_paths` normalizes each user-supplied path argument to a repository-relative Git path. If the normalized path is empty — meaning the argument referred to the repository root or degenerated to nothing — it bails, because spilling requires a path that actually names a file within the change set.","triggerScenarios":"Passing `/`, `.` or the worktree root as a path argument to the spill command so `repository.normalize_path` yields an empty path; `changes.paths` then has no usable per-file entry for it.","commonSituations":"Shell globs expanding to the repo root; copy-pasting a directory or root path where a file path is required; running the command from an odd working directory so a relative path normalizes to empty.","solutions":["Pass explicit file paths that exist in the change set instead of the repository root or `.`.","Verify each argument names a file touched by the current changes (check the todo/changes view).","Run the command from the repository root with repo-relative paths.","Guard scripts to filter out directory/root arguments before invoking spill."],"exampleFix":"// before\ngix tix spill .\n// after\ngix tix spill src/main.rs src/lib.rs","handlingStrategy":"validation","validationCode":"// Before calling spill: ensure every argument normalizes to a non-empty repo-relative file path.\nlet norm = repo.normalize_path(git_path(arg))?;\nif norm.is_empty() { skip_or_error(arg); }","typeGuard":"fn is_named_file_path(p: &BString) -> bool { !p.is_empty() }","tryCatchPattern":"match run_spill(repo, paths) { Err(e) if e.to_string().starts_with(\"path \") && e.to_string().contains(\"does not name a file\") => { /* drop root/dir args and retry */ } other => other }","preventionTips":["Reject directory or root arguments before invoking spill.","Run from the repository root with explicit file paths.","Validate arguments against the set of changed paths first."],"tags":["git","tix","path","validation","cli"],"backgroundTag":"invalid-argument-value","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}