{"record":{"id":"50d8f6d15224204c","repo":"gitbutlerapp/gitbutler","slug":"target-ref-name-resolved-from-target-ref-i","errorCode":null,"errorMessage":"Target ref '{name}' resolved from '{target_ref}' is not a remote-tracking branch; use --extra-target for arbitrary revisions","messagePattern":"Target ref '(.+?)' resolved from '(.+?)' is not a remote-tracking branch; use --extra-target for arbitrary revisions","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-debug/src/command/revision.rs","lineNumber":160,"sourceCode":"        );\n    };\n    writeln!(out, \"{merge_base}\")?;\n\n    Ok(())\n}\n\nfn args_to_tips(repo: &gix::Repository, graph_args: &RevisionGraphArgs) -> Result<Vec<Tip>> {\n    let mut tips = Vec::new();\n\n    if let Some(tip) = graph_args\n        .target_ref\n        .as_deref()\n        .map(|target_ref| {\n            let mut reference = repo\n                .find_reference(target_ref)\n                .with_context(|| format!(\"Failed to find target ref '{target_ref}'\"))?;\n            let name = reference.name().to_owned();\n            ensure!(\n                name.category() == Some(Category::RemoteBranch),\n                \"Target ref '{name}' resolved from '{target_ref}' is not a remote-tracking branch; use --extra-target for arbitrary revisions\"\n            );\n            let id = reference.peel_to_id()?.detach();\n            Ok(Tip::integrated(id, Some(name)))\n        })\n        .transpose()?\n    {\n        tips.push(tip);\n    }\n\n    if let Some(tip) = graph_args\n        .extra_target\n        .as_deref()\n        .map(|rev| {\n            repo.rev_parse_single(rev)\n                .map(|id| Tip::integrated(id.detach(), None))\n                .with_context(|| format!(\"Failed to resolve extra target '{rev}'\"))","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-debug/src/command/revision.rs#L142-L178","documentation":"Thrown by args_to_tips() in but-debug's revision command when --target-ref resolves to a reference whose gix category is not RemoteBranch. The revision graph treats 'target' tips specially (the remote-tracking branch the workspace integrates with), so arbitrary revisions must go through --extra-target instead.","triggerScenarios":"Running `but debug revision ... --target-ref <name>` where <name> is a local branch (refs/heads/...), a tag (refs/tags/...), HEAD, or any non refs/remotes/... reference.","commonSituations":"Passing 'main' instead of 'origin/main' or 'refs/remotes/origin/main'; passing a tag or a commit SHA where the graph expects the integrated remote-tracking branch; a ref name that git resolves through a symbolic ref to something non-remote.","solutions":["Use the remote-tracking name, e.g. --target-ref origin/main or the full refs/remotes/origin/main.","If you really want an arbitrary revision (local branch, tag, commit), pass it via --extra-target instead of --target-ref.","Run `git for-each-ref refs/remotes` to see which remote-tracking refs actually exist in this clone."],"exampleFix":"# before\nbut debug revision graph --target-ref main\n\n# after\nbut debug revision graph --target-ref refs/remotes/origin/main\n# or, for an arbitrary revision:\nbut debug revision graph --extra-target main","handlingStrategy":"validation","validationCode":"# before invoking the CLI\nif ! git show-ref --verify --quiet \"refs/remotes/$TARGET\"; then\n  echo \"$TARGET is not a remote-tracking branch\" >&2\n  exit 2\nfi","typeGuard":null,"tryCatchPattern":"Wrap the CLI invocation and on non-zero exit, if stderr contains 'not a remote-tracking branch', print a hint to use refs/remotes/<remote>/<branch> or --extra-target.","preventionTips":["Default --target-ref values to refs/remotes/<remote>/<branch> built from the remote name.","Remember --target-ref is for the integrated remote-tracking tip only; everything else is --extra-target."],"tags":["rust","cli","git","ref-validation","debug-tooling"],"backgroundTag":"invalid-git-ref","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}