gitbutlerapp/gitbutler · error
'{raw_id}' no found
Error message
'{raw_id}' no found What it means
filter_uncommitted_hunks re-parses every raw hunk id from the IdMap against the current diff context (parse_using_context). An empty result means the id matches no CLI hunk anymore - the worktree changed between listing and selection. The message's 'no found' means 'not found'.
Source
Thrown at crates/but/src/utils/diff_rendering.rs:1161
fn filter_uncommitted_hunks<'a, F>(
ctx: &'a Context,
id_map: &'a IdMap,
mut filter: F,
) -> anyhow::Result<Vec<(&'a str, Arc<CliId>, &'a UncommittedHunk)>>
where
F: FnMut(&but_core::SingleHunk) -> bool,
{
let mut uncommitted_hunks = id_map
.uncommitted_hunks
.iter()
.filter(move |(_, hunk)| filter(&hunk.hunk))
.map(|(raw_id, hunk)| {
let mut cli_ids = id_map.parse_using_context(raw_id, ctx)?;
if cli_ids.len() == 1 {
Ok((&**raw_id, Arc::new(cli_ids.remove(0)), hunk))
} else if cli_ids.is_empty() {
bail!("'{raw_id}' no found")
} else {
bail!(
"'{raw_id}' resolved to more than one hunk ({})",
cli_ids.len()
)
}
})
.collect::<anyhow::Result<Vec<_>>>()?;
uncommitted_hunks.sort_by(|(id_a, _, hunk_a), (id_b, _, hunk_b)| {
(
&hunk_a.hunk.path,
hunk_a
.hunk
.hunk_header
.as_ref()
.map(|header| header.old_start),
id_a,View on GitHub (pinned to caf1f223d3)
Solutions
- Re-run the listing command to get fresh hunk ids, then retry the selection
- Ensure no file changes happen between listing and selecting hunks
- If another process touched the worktree, let it finish, then refresh the ids
Defensive patterns
Strategy: retry
Try / catch
match filter_uncommitted_hunks(ctx, &id_map, filter) {
Err(e) if e.to_string().contains("no found") => {
// worktree changed: recompute IdMap, re-list hunk ids, reselect once
}
r => r,
} Prevention
- Re-resolve ids in the same operation that listed them
- Treat any worktree write as invalidating cached hunk ids
- When this fires, show the user a fresh listing instead of the raw error
When it happens
Trigger: Listing hunk ids, then modifying/staging/reverting files before selecting one; a concurrent process (editor, formatter, another but invocation) alters the worktree; ids come from a stale listing.
Common situations: Interactive hunk-selection flows (squash/discard) where the user edits files mid-session, long-lived shells holding old ids, CI retrying an operation after files changed.
Related errors
- No diffs to show.
- Could not discard all selected changes: {refused_paths}
- '{raw_id}' resolved to more than one hunk ({})
- Cannot compute diff specs for worktree `{name}`
- No uncommitted changes to discard
AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20).
Data as JSON: /api/errors/3e3dd2ac564380ea.
Report an issue: GitHub.