{"record":{"id":"a7e5c4bb7817edb5","repo":"GitoxideLabs/gitoxide","slug":"extra-header-lookup-is-only-meaningful-in-threaded","errorCode":null,"errorMessage":"extra-header-lookup is only meaningful in threaded mode","messagePattern":"extra-header-lookup is only meaningful in threaded mode","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/odb.rs","lineNumber":209,"sourceCode":"            |ids, (handle, counter)| {\n                let ids = ids?;\n                counter.fetch_add(ids.len(), Ordering::Relaxed);\n                let out = ids\n                    .into_iter()\n                    .map(|id| handle.header(id).map(|hdr| (id, hdr)))\n                    .collect::<Result<Vec<_>, _>>()?;\n                Ok(out)\n            },\n            Reduce {\n                stats: Statistics {\n                    ids: extra_header_lookup.then(Vec::new),\n                    ..Default::default()\n                },\n            },\n        )?\n    } else {\n        if extra_header_lookup {\n            bail!(\"extra-header-lookup is only meaningful in threaded mode\");\n        }\n        let mut stats = Statistics::default();\n\n        for (count, id) in object_ids.enumerate() {\n            if count % chunk_size == 0 && gix::interrupt::is_triggered() {\n                return Err(cancelled());\n            }\n            stats.consume(repo.objects.header(id)?);\n            progress.inc();\n        }\n        stats\n    };\n\n    progress.show_throughput(start);\n\n    if let Some(mut ids) = stats.ids.take() {\n        // Critical to re-open the repo to assure we don't have any ODB state and start fresh.\n        let start = std::time::Instant::now();","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/odb.rs#L191-L227","documentation":"In `gix repo odb statistics`, the `extra-header-lookup` option only applies when object lookups run on multiple threads. In single-threaded mode the option has no effect, so the command rejects it explicitly rather than silently ignoring it.","triggerScenarios":"Running odb statistics without the threaded/threads option (single-threaded path in `statistics()`) while passing `extra_header_lookup == true`.","commonSituations":"Copying a threaded benchmark invocation into an environment where threading was disabled; passing a flag intended for a different mode of the same command.","solutions":["Enable the threaded mode (pass the threads option) so extra-header-lookup takes effect.","Remove `--extra-header-lookup` when running single-threaded.","If throughput is not the goal, drop the flag — it only matters for pack multi-threaded statistics."],"exampleFix":"// before (single-threaded)\ngix repo odb statistics --extra-header-lookup <pack>\n// after\ngix repo odb statistics --threads 4 --extra-header-lookup <pack>","handlingStrategy":"validation","validationCode":"if extra_header_lookup && threads == 0 { // 0 = single-threaded\n    eprintln!(\"dropping --extra-header-lookup: only meaningful threaded\");\n    extra_header_lookup = false;\n}","typeGuard":null,"tryCatchPattern":"match odb_statistics(...) {\n    Err(e) if e.to_string().contains(\"extra-header-lookup\") => retry_without_flag(),\n    r => r?,\n}","preventionTips":["Only pass pack-specific flags (extra-header-lookup) when threads > 1.","Read the flag's help text — some options are mode-dependent."],"tags":["cli","odb","pack","threading","gitoxide"],"backgroundTag":"conflicting-config-options","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}