{"record":{"id":"bf1c1fa2ab6e1ad4","repo":"GitoxideLabs/gitoxide","slug":"show-requires-at-least-one-x-hide-revision-when","errorCode":null,"errorMessage":"show requires at least one -x/--hide revision when no remote HEAD maps to a local branch","messagePattern":"show requires at least one -x/--hide revision when no remote HEAD maps to a local branch","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-tix/src/command.rs","lineNumber":295,"sourceCode":"    let (hide, unavailable) = crate::history::available_hidden_revisions(repository, &args.hide, !args.no_auto_hide)?;\n    for (revision, err) in unavailable {\n        eprintln!(\n            \"warning: ignoring unavailable hidden revision {}: {err}\",\n            revision.to_string_lossy()\n        );\n    }\n    let revisions = if args.revisions.is_empty() {\n        crate::history::ref_tree_revisions(repository, !args.no_tags)?\n    } else {\n        args.revisions\n    };\n    crate::ref_tree::render_full(repository, &revisions, &hide, !args.no_tags, args.unicode)\n}\n\nfn show(repository: &gix::Repository, args: Show) -> Result<()> {\n    let (hide, unavailable) = crate::history::available_hidden_revisions(repository, &args.hide, !args.no_auto_hide)?;\n    if hide.is_empty() {\n        anyhow::bail!(\"show requires at least one -x/--hide revision when no remote HEAD maps to a local branch\");\n    }\n    for (revision, err) in unavailable {\n        eprintln!(\n            \"warning: ignoring unavailable hidden revision {}: {err}\",\n            revision.to_string_lossy()\n        );\n    }\n    write_history(repository, &args.revisions, &hide, std::io::stdout().lock())\n}\n\nfn write_history(\n    repository: &gix::Repository,\n    revisions: &[OsString],\n    hide: &[OsString],\n    mut out: impl Write,\n) -> Result<()> {\n    let authors = gix::features::threading::OwnShared::new(gix::features::threading::Mutable::new(\n        crate::history::Authors::default(),","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-tix/src/command.rs#L277-L313","documentation":"`gix_tix::command::show` builds the history view from hidden revisions (`-x/--hide`). When `available_hidden_revisions` resolves to an empty set — no `-x` revisions were given or none mapped to a local branch via remote-HEAD auto-hide — it bails, since showing a history view with nothing hidden is not a meaningful invocation in this mode.","triggerScenarios":"Running `gix tix show` without any `-x/--hide` revision while `--no-auto-hide` is set (or no remote HEAD maps to a local branch), so `hide.is_empty()` after `available_hidden_revisions`.","commonSituations":"Invoking `tix show` in a repo without remotes/remote HEAD configured while relying on auto-hide; forgetting the `-x` flag; passing an unavailable/unresolvable revision to `-x` so all candidates were dropped as unavailable.","solutions":["Pass at least one `-x/--hide <revision>` pointing at an existing local branch or commit.","Ensure a remote HEAD exists that maps to a local branch so auto-hide can supply the hidden base.","Remove `--no-auto-hide` if you intended the remote HEAD to be hidden automatically.","Check the `warning: ignoring unavailable hidden revision ...` lines on stderr and fix the named revisions."],"exampleFix":"// before\ngix tix show --no-auto-hide\n// after\ngix tix show -x main","handlingStrategy":"validation","validationCode":"// Before invoking: ensure at least one -x revision resolves to a local branch.\nif hide_args.is_empty() && (no_auto_hide || remote_head_has_no_local_branch(repo)) { return Err(\"pass -x/--hide\"); }","typeGuard":null,"tryCatchPattern":"match show(repo, &args) { Err(e) if e.to_string().contains(\"show requires at least one -x/--hide\") => { /* prompt for or inject a -x revision and retry */ } other => other }","preventionTips":["Always pass an explicit -x/--hide revision in scripts.","Verify each -x revision resolves locally before invoking show.","Do not combine --no-auto-hide with an empty -x list."],"tags":["cli","git","tix","missing-argument","revisions"],"backgroundTag":"missing-required-flag","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"}