{"record":{"id":"c10cace7e859c538","repo":"gitbutlerapp/gitbutler","slug":"line-line-number-unknown-command-other","errorCode":null,"errorMessage":"line {line_number}: unknown command '{other}'","messagePattern":"line (.+?): unknown command '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs","lineNumber":101,"sourceCode":"                    .map(|commit| {\n                        resolve_commit(commit, &allowed_commits).map_err(|err| {\n                            anyhow::anyhow!(\n                                \"line {line_number}: invalid squash commit '{commit}': {err}\"\n                            )\n                        })\n                    })\n                    .collect::<Result<Vec<_>>>()?;\n                InteractiveIntegrationStep::Squash {\n                    commits,\n                    message: message_part\n                        .map(parse_message_clause)\n                        .transpose()\n                        .map_err(|err| {\n                            anyhow::anyhow!(\"line {line_number}: invalid squash message: {err}\")\n                        })?,\n                }\n            }\n            other => bail!(\"line {line_number}: unknown command '{other}'\"),\n        };\n        steps.push(step);\n    }\n\n    Ok(steps)\n}\n\nfn render_step(step: &InteractiveIntegrationStep) -> String {\n    match step {\n        InteractiveIntegrationStep::Pick { commit_id } => format!(\"pick {}\", short_id(*commit_id)),\n        InteractiveIntegrationStep::Merge { commit_id } => {\n            format!(\"merge {}\", short_id(*commit_id))\n        }\n        InteractiveIntegrationStep::Squash { commits, message } => {\n            let mut rendered = format!(\n                \"squash {}\",\n                commits\n                    .iter()","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L83-L119","documentation":"The integration script DSL only supports three commands: `pick`, `merge`, and `squash`. Any other first token on a non-comment line causes this error, which names the unrecognized command and the line number. This keeps edited scripts from silently dropping steps (a la `git rebase -i`'s `drop`), since silently ignoring unknown commands could lose integration intent.","triggerScenarios":"Calling parse_integration_steps_script with a line whose first whitespace-delimited token is not `pick`, `merge`, or `squash` — e.g. `drop 3333333`, `reword ...`, `fixup ...`, or a typo like `pik 3333333`.","commonSituations":"Users paste lines from `git rebase -i` todo files (`drop`, `reword`, `fixup`, `edit`, `exec`), or mistype a command. Blank lines and lines starting with `#` are ignored, so comments never trigger this.","solutions":["Replace the unknown command with `pick <hash>` for a single local/upstream commit.","Use `merge <hash>` for upstream commits to merge, or `squash <hash1> <hash2> [...] | message=\"...\"` to combine commits.","If you wanted to drop a commit, delete the line entirely — commands absent from the script are simply not applied.","Fix typos in the command keyword (e.g. `pik` -> `pick`)."],"exampleFix":"// before (script text)\ndrop 3333333\n// after\n# line removed to drop the commit\n","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['pick', 'merge', 'squash']);\nfunction validateCommands(script: string): string[] {\n  return script.split('\\n').flatMap((line, i) => {\n    const t = line.trim();\n    if (!t || t.startsWith('#')) return [];\n    const cmd = t.split(/\\s+/)[0];\n    return ALLOWED.has(cmd) ? [] : [`line ${i + 1}: unknown command '${cmd}'`];\n  });\n}","typeGuard":"const isKnownCommand = (line: string): boolean =>\n  ['pick', 'merge', 'squash'].includes(line.trim().split(/\\s+/)[0]);","tryCatchPattern":"try {\n  const steps = await parseIntegrationScript(script, divergence);\n} catch (err) {\n  const m = /line (\\d+): unknown command '(.+)'/.exec(String(err));\n  if (m) showEditorErrorAtLine(Number(m[1]), `'${m[2]}' is not a valid command; use pick/merge/squash`);\n  else throw err;\n}","preventionTips":["Only use pick, merge, and squash — rebase-todo commands like drop/reword/fixup are not supported.","To drop a commit, delete its line; to reword a squash result, use its `| message=` clause.","Add notes as `#` comment lines so they are never parsed as commands."],"tags":["parsing","script-validation","unknown-command","git"],"backgroundTag":"invalid-enum-value","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"}