{"record":{"id":"21fa452288cb48a0","repo":"gitbutlerapp/gitbutler","slug":"s-does-not-name-an-uncommitted-change-or-branc","errorCode":null,"errorMessage":"'{s}' does not name an uncommitted change or branch; refusing to absorb everything","messagePattern":"'(.+?)' does not name an uncommitted change or branch; refusing to absorb everything","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/absorb.rs","lineNumber":61,"sourceCode":"    let mut guard = ctx.exclusive_worktree_access();\n    let id_map = IdMap::new_from_context(ctx, guard.read_permission())?;\n    let source: Option<CliId> = source\n        .map(|s| -> anyhow::Result<CliId> {\n            // Uncommitted selectors resolve in the uncommitted namespace first\n            // so later commits cannot shadow them; branch selectors resolve in\n            // the full namespace. A selector that names neither is an error —\n            // silently falling back to absorbing everything is never intended.\n            let resolved =\n                match crate::id::parser::resolve_uncommitted_part(ctx, &id_map, s) {\n                    Ok(ids) if !ids.is_empty() => ids,\n                    _ => parse_sources(ctx, &id_map, s)?,\n                };\n            let mut acceptable = resolved.into_iter().filter(|id| {\n                matches!(id, CliId::UncommittedHunkOrFile { .. })\n                    || matches!(id, CliId::Branch(..))\n            });\n            let first = acceptable.next().ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"'{s}' does not name an uncommitted change or branch; refusing to absorb everything\"\n                )\n            })?;\n            if acceptable.next().is_some() {\n                anyhow::bail!(\n                    \"'{s}' is ambiguous - it matches more than one uncommitted change. Use more characters to disambiguate.\"\n                );\n            }\n            Ok(first)\n        })\n        .transpose()?;\n\n    let target = if let Some(source) = source {\n        match source {\n            CliId::UncommittedHunkOrFile(UncommittedHunkOrFile { hunks, .. }) => {\n                // Absorb this particular file\n                AbsorptionTarget::Hunks {\n                    hunks: hunks.map(|id_and_hunk| id_and_hunk.hunk).into(),","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/absorb.rs#L43-L79","documentation":"`but absorb <s>` resolves the user's short id string to `CliId`s and filters for uncommitted hunks/files or branches. If the string matches nothing acceptable, the CLI refuses to run absorb rather than defaulting to absorbing everything, raising this error to prevent a destructive over-broad operation.","triggerScenarios":"Passing an argument that resolves only to commit ids or other non-absorbable CliId kinds (the filter empties the iterator); typos in the id prefix; referring to a file that is already committed.","commonSituations":"Typing a partial commit-id instead of a branch/hunk id; using a filename that is already committed so it no longer maps to an uncommitted hunk; after committing everything there are no uncommitted changes to name.","solutions":["Run `but` (status) and copy the exact id shown for the uncommitted change or branch you want to absorb","Extend the prefix characters until the id resolves uniquely to an uncommitted hunk/file or branch","Verify the change is still uncommitted; commit it or absorb a different id if it is already absorbed","If you truly want to absorb everything, omit the argument (if supported) rather than passing a non-matching id"],"exampleFix":"// before: commit id passed, filter matches nothing\nbut absorb 3f9c  // Error: '3f9c' does not name an uncommitted change or branch\n\n// after: use the uncommitted-change/branch id from `but` status\nbut absorb a1    // e.g. 'a1' resolves to an uncommitted hunk or branch","handlingStrategy":"validation","validationCode":"// verify the prefix resolves to exactly one uncommitted change or branch first\nbut  # inspect listed CliIds; confirm your prefix matches an UncommittedHunkOrFile or Branch row","typeGuard":"// before calling absorb, resolve and classify\nlet ids = cli.resolve(s)?;\nif !ids.iter().any(|id| matches!(id, CliId::UncommittedHunkOrFile{..} | CliId::Branch(_))) {\n    eprintln!(\"'{s}' is not an uncommitted change or branch\");\n    return Ok(());\n}","tryCatchPattern":null,"preventionTips":["Copy ids directly from `but` status output instead of typing prefixes","Lengthen the id prefix until unambiguous","Check the change is still uncommitted before absorbing"],"tags":["cli","cli-argument","absorb","ambiguity"],"backgroundTag":"invalid-cli-argument","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}