GitoxideLabs/gitoxide · error

show requires at least one -x/--hide revision when no…

Error message

show requires at least one -x/--hide revision when no remote HEAD maps to a local branch

What it means

`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.

Solutions

  1. Pass at least one `-x/--hide <revision>` pointing at an existing local branch or commit.
  2. Ensure a remote HEAD exists that maps to a local branch so auto-hide can supply the hidden base.
  3. Remove `--no-auto-hide` if you intended the remote HEAD to be hidden automatically.
  4. Check the `warning: ignoring unavailable hidden revision ...` lines on stderr and fix the named revisions.

Example fix

// before
gix tix show --no-auto-hide
// after
gix tix show -x main
Defensive patterns

Strategy: validation

Validate before calling

// Before invoking: ensure at least one -x revision resolves to a local branch.
if hide_args.is_empty() && (no_auto_hide || remote_head_has_no_local_branch(repo)) { return Err("pass -x/--hide"); }

Try / catch

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 }

Prevention

When it happens

Trigger: 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`.

Common situations: 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.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08). Data as JSON: /api/errors/bf1c1fa2ab6e1ad4. Report an issue: GitHub.

Appendix: source

Thrown at gix-tix/src/command.rs:295

    let (hide, unavailable) = crate::history::available_hidden_revisions(repository, &args.hide, !args.no_auto_hide)?;
    for (revision, err) in unavailable {
        eprintln!(
            "warning: ignoring unavailable hidden revision {}: {err}",
            revision.to_string_lossy()
        );
    }
    let revisions = if args.revisions.is_empty() {
        crate::history::ref_tree_revisions(repository, !args.no_tags)?
    } else {
        args.revisions
    };
    crate::ref_tree::render_full(repository, &revisions, &hide, !args.no_tags, args.unicode)
}

fn show(repository: &gix::Repository, args: Show) -> Result<()> {
    let (hide, unavailable) = crate::history::available_hidden_revisions(repository, &args.hide, !args.no_auto_hide)?;
    if hide.is_empty() {
        anyhow::bail!("show requires at least one -x/--hide revision when no remote HEAD maps to a local branch");
    }
    for (revision, err) in unavailable {
        eprintln!(
            "warning: ignoring unavailable hidden revision {}: {err}",
            revision.to_string_lossy()
        );
    }
    write_history(repository, &args.revisions, &hide, std::io::stdout().lock())
}

fn write_history(
    repository: &gix::Repository,
    revisions: &[OsString],
    hide: &[OsString],
    mut out: impl Write,
) -> Result<()> {
    let authors = gix::features::threading::OwnShared::new(gix::features::threading::Mutable::new(
        crate::history::Authors::default(),

View on GitHub (pinned to e73179060b)