{"record":{"id":"b91eccfd64422dad","repo":"gastownhall/beads","slug":"unsupported-git-object-format-q","errorCode":null,"errorMessage":"unsupported git object format %q","messagePattern":"unsupported git object format %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/worktree_cmd.go","lineNumber":1842,"sourceCode":"\treturn matches, nil\n}\n\nfunc repositoryObjectIDLength(\n\tctx context.Context,\n\tgit *worktreeRemovalGit,\n\texecutionRoot string,\n) (int, error) {\n\toutput, err := git.output(ctx, executionRoot, \"rev-parse\", \"--show-object-format\")\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"failed to determine repository object format: %w\", err)\n\t}\n\tswitch strings.TrimSpace(string(output)) {\n\tcase \"sha1\":\n\t\treturn 40, nil\n\tcase \"sha256\":\n\t\treturn 64, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unsupported git object format %q\", strings.TrimSpace(string(output)))\n\t}\n}\n\nfunc isHexObjectID(value string, length int) bool {\n\tif len(value) != length {\n\t\treturn false\n\t}\n\tfor _, character := range value {\n\t\tif character >= '0' && character <= '9' ||\n\t\t\tcharacter >= 'a' && character <= 'f' ||\n\t\t\tcharacter >= 'A' && character <= 'F' {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\treturn true\n}\n","sourceCodeStart":1824,"sourceCodeEnd":1860,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/worktree_cmd.go#L1824-L1860","documentation":"After querying `git rev-parse --show-object-format`, bd only accepts `sha1` (40-char OIDs) or `sha256` (64-char). Any other output triggers this error reporting the unexpected format string.","triggerScenarios":"git returns an unexpected object-format value — empty output (command partially failed but exit 0), future/unknown hash algorithms, or whitespace/garbage output from a shimmed git binary.","commonSituations":"Wrapper scripts around `git` that emit extra output; experimental git builds; an empty repository where output is blank.","solutions":["Check `git rev-parse --show-object-format` output directly; it must print `sha1` or `sha256`","Remove any git wrapper/shim that adds extra output","Reinstall a standard git build","Upgrade git if using a nonstandard hash algorithm build"],"exampleFix":"// diagnose\ngit rev-parse --show-object-format   # should print: sha1\n// fix: remove wrapper emitting extra lines\nwhich git && cat $(which git)","handlingStrategy":"validation","validationCode":"// shell pre-check\nfmt=$(git rev-parse --show-object-format 2>/dev/null)\ncase \"$fmt\" in sha1|sha256) ;; *) echo \"unexpected object format: '$fmt'\" ;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use stock git binaries, not wrapper scripts that add output","Confirm the repo's extensions.objectFormat is sha1 or sha256","Re-clone if the repository metadata is corrupt"],"tags":["git","object-format","sha256","cli"],"backgroundTag":"unsupported-git-object-format","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}