{"record":{"id":"88bb5df34c4b51e0","repo":"gitbutlerapp/gitbutler","slug":"unsupported-escape-sequence-other","errorCode":null,"errorMessage":"unsupported escape sequence '\\{other}'","messagePattern":"unsupported escape sequence '\\\\(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs","lineNumber":194,"sourceCode":"    parse_quoted_string(value)\n}\n\nfn parse_quoted_string(input: &str) -> Result<String> {\n    if !input.starts_with('\"') {\n        bail!(\"message must start with a double quote\");\n    }\n\n    let mut output = String::new();\n    let mut escaped = false;\n    for (index, ch) in input.char_indices().skip(1) {\n        if escaped {\n            let resolved = match ch {\n                '\\\\' => '\\\\',\n                '\"' => '\"',\n                'n' => '\\n',\n                'r' => '\\r',\n                't' => '\\t',\n                other => bail!(\"unsupported escape sequence '\\\\{other}'\"),\n            };\n            output.push(resolved);\n            escaped = false;\n            continue;\n        }\n\n        match ch {\n            '\\\\' => escaped = true,\n            '\"' => {\n                let trailing = input[index + ch.len_utf8()..].trim();\n                if trailing.is_empty() {\n                    return Ok(output);\n                }\n                bail!(\"unexpected trailing characters after quoted message\");\n            }\n            other => output.push(other),\n        }\n    }","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-workspace/src/branch/integrate_branch_upstream/parsing.rs#L176-L212","documentation":"Inside a quoted `message=\"...\"` clause, only a fixed set of escape sequences is supported: `\\\\`, `\\\"`, `\\n`, `\\r`, `\\t`. Any other backslash-prefixed character raises this error, wrapped as `line N: invalid squash message: unsupported escape sequence '\\x'`. The parser is strict so that rendered scripts round-trip exactly.","triggerScenarios":"Calling parse_integration_steps_script with a squash message containing an unsupported escape such as `\\0`, `\\u0041`, `\\/`, or a trailing lone backslash before a character not in the allowed set.","commonSituations":"Users paste shell-escaped or JSON-style strings (`\\uXXXX` unicode escapes) into the message, or add a Windows-style path with `\\` separators without doubling the backslashes.","solutions":["Replace unsupported escapes with the allowed set: `\\\\` for backslash, `\\\"` for quote, `\\n`, `\\r`, `\\t` for control characters.","Write literal characters directly instead of escaping them (e.g. type `/` instead of `\\/`, real characters instead of `\\uXXXX`).","Double any literal backslashes in the message (e.g. a path `C:\\dir` becomes `C:\\\\dir`).","Remove the message clause if complex escaping is not worth it; the step keeps the default commit message."],"exampleFix":"// before (script text)\nsquash 2222222 3333333 | message=\"path C:\\dir\"\n// after\nsquash 2222222 3333333 | message=\"path C:\\\\dir\"\n","handlingStrategy":"validation","validationCode":"function validateEscapes(line: string, lineNo: number): string | null {\n  const m = line.match(/\\|\\s*message=\"((?:[^\"\\\\]|\\\\.)*)\"/);\n  if (!m) return null;\n  const bad = m[1].match(/\\\\(?!\\\\|\"|n|r|t)/g);\n  if (bad) return `line ${lineNo}: unsupported escape sequence near ${bad[0]}`;\n  return null;\n}","typeGuard":"const escapesAreSupported = (line: string): boolean => {\n  const m = line.match(/\\|\\s*message=\"((?:[^\"\\\\]|\\\\.)*)\"/);\n  return !m || !/\\\\(?!\\\\|\"|n|r|t)/.test(m[1]);\n};","tryCatchPattern":"try {\n  const steps = await parseIntegrationScript(script, divergence);\n} catch (err) {\n  const m = /unsupported escape sequence '\\\\(.)'/.exec(String(err));\n  if (m) showEditorHint(`escape \\\\${m[1]} is not supported; use \\\\\\\\, \\\\\" , \\\\n, \\\\r, or \\\\t`);\n  else throw err;\n}","preventionTips":["Limit escapes to \\\\\\\\, \\\\\" , \\\\n, \\\\r, and \\\\t.","Double every literal backslash (e.g. Windows paths) inside messages.","Avoid JSON/unicode-style escapes like \\\\uXXXX — write the literal character instead."],"tags":["parsing","script-validation","escaping","git"],"backgroundTag":"invalid-argument-format","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"}