{"record":{"id":"e6128e9f265f47b5","repo":"nikivdev/code","slug":"commit-queue-is-empty-run-f-pr-message-or-que","errorCode":null,"errorMessage":"Commit queue is empty. Run `f pr \"message\"` or queue a commit first with `f commit --queue`.","messagePattern":"Commit queue is empty\\. Run `f pr \"message\"` or queue a commit first with `f commit --queue`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/commit.rs","lineNumber":9598,"sourceCode":"            false,\n            review_selection,\n            message.as_deref(),\n            1000,\n            false,\n            queue,\n            false,\n            &opts.paths,\n            CommitGateOverrides::default(),\n        )?;\n    }\n\n    let hash = if let Some(hash) = opts.hash {\n        hash\n    } else {\n        let _ = refresh_commit_queue(&repo_root);\n        let mut entries = load_commit_queue_entries(&repo_root)?;\n        let Some(entry) = entries.pop() else {\n            bail!(\n                \"Commit queue is empty. Run `f pr \\\"message\\\"` or queue a commit first with `f commit --queue`.\"\n            );\n        };\n        entry.commit_sha\n    };\n\n    run_commit_queue(CommitQueueCommand {\n        action: Some(CommitQueueAction::PrCreate {\n            hash,\n            base: opts.base,\n            draft: opts.draft,\n            open: !opts.no_open,\n        }),\n    })\n}\n\nfn run_pr_open(repo_root: &Path, opts: &PrOpts) -> Result<()> {\n    ensure_gh_available()?;","sourceCodeStart":9580,"sourceCodeEnd":9616,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L9580-L9616","documentation":"When no explicit `--hash` is supplied, the command refreshes and loads the commit queue and takes the most recent entry to operate on. If the queue is empty (`entries.pop()` returns None) there is nothing to act on, so it bails with guidance on how to populate the queue (`f pr \"message\"` or `f commit --queue`).","triggerScenarios":"Running the push/approve command with no `--hash` before any commit has been queued; queue was cleared/consumed by an earlier run; `refresh_commit_queue` pruned stale entries; wrong repo root so the queue file isn't found.","commonSituations":"Fresh clone or new machine where the queue file never existed; running the command twice (first run popped the entry); forgetting to run `f commit --queue` first.","solutions":["Queue a commit first: `f commit --queue` or `f pr \"message\"`.","Pass an explicit `--hash <sha>` to bypass the queue.","Check the queue contents (queue file/`f commit` list) to confirm it is empty and why.","Verify you are in the intended repository root."],"exampleFix":"// before\nf pr push          # queue empty\n// after\nf commit --queue\nf pr push          # or: f pr push --hash <sha>","handlingStrategy":"validation","validationCode":"let q = load_commit_queue_entries(&repo_root)?;\nif q.is_empty() {\n    eprintln!(\"Queue empty: run `f commit --queue` or pass --hash <sha>\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = run() {\n    if e.to_string().contains(\"Commit queue is empty\") { queue_first_then_retry(); }\n    else { return Err(e.into()); }\n}","preventionTips":["Queue with `f commit --queue` (or `f pr \"msg\"`) before pushing.","Remember the queue entry is consumed by each run - re-queue for repeat runs.","Pass `--hash` when you want to bypass the queue entirely.","Check queue contents before scripting repeated invocations."],"tags":["cli","queue","empty-state"],"backgroundTag":"queue-empty","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}