{"record":{"id":"83e98e91c9ce37ee","repo":"santifer/career-ops","slug":"update-commit-failed-files-may-be-staged-but-not","errorCode":null,"errorMessage":"Update commit failed (files may be staged but not committed).\n    Error: ${e.message.split('\\n')[0]}\n    Please run manually to finish the update:\n    ${recovery}","messagePattern":"Update commit failed \\(files may be staged but not committed\\)\\.\n    Error: (.+?)\n    Please run manually to finish the update:\n    (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"update-system.mjs","lineNumber":2197,"sourceCode":"            CAREER_OPS_UPDATE_REEXEC_TOKEN: marker.token,\n            // Compatibility for target updaters before the authenticated\n            // marker was introduced; only the authenticated child receives it.\n            CAREER_OPS_UPDATE_REEXEC: '1',\n            CAREER_OPS_UPDATE_BACKUP_BRANCH: backupBranch,\n            ...(updateForce ? { CAREER_OPS_UPDATE_FORCE: '1' } : {}),\n            // Keep the legacy confirmation channel for older target updaters;\n            // this process still requires the authenticated marker above.\n            CAREER_OPS_UPDATE_CONFIRM: '1',\n          },\n        });\n        return;\n      } catch (err) {\n        if (isTimeoutLikeError(err)) {\n          console.error(`Updater self-reexec timed out after ${timeoutSeconds(timeout)}s.`);\n          throw err;\n        }\n        console.error(`Updater self-reexec failed: ${err.message}`);\n        throw err;\n      }\n    }\n\n    // 3. Checkout system files only\n    console.log('Updating system files...');\n    const updated = [];\n    let remoteSystemPaths = [];\n    try {\n      const remoteUpdaterSource = git('show', 'FETCH_HEAD:update-system.mjs');\n      remoteSystemPaths = extractArrayFromSource(remoteUpdaterSource, 'SYSTEM_PATHS');\n    } catch {\n      // Older targets may not have update-system.mjs. Fall back to the\n      // local manifest plus bootstrap paths below.\n    }\n\n    // 3a. Keep bootstrap paths as a fallback for very old targets, but the\n    // target updater's SYSTEM_PATHS is now the source of truth for new files.\n    const updatePaths = mergePathLists(SYSTEM_PATHS, remoteSystemPaths, BOOTSTRAP_PATHS);","sourceCodeStart":2179,"sourceCodeEnd":2215,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/update-system.mjs#L2179-L2215","documentation":"The final step of `update-system.mjs apply` commits the staged system files (chore: auto-update system files to vX.Y.Z). If `git commit` fails while the changed paths are still staged (confirmed via git status), apply throws this error with a ready-to-copy recovery command that matches the strategy actually used: a plain commit after an index-wide stage, or a pathspec commit when paths were staged individually — the pathspec form preserves staged file modes, so suggesting the wrong one would quietly reintroduce the bug it recovers from.","triggerScenarios":"No git identity configured (user.name/user.email unset, git aborts with 'Please tell me who you are'); a pre-commit hook (husky, pre-commit framework) rejecting the auto-commit; index.lock held by a concurrent git process; detached HEAD or read-only .git.","commonSituations":"Fresh machines and CI runners that never ran git config; hook managers intercepting maintenance commits; users who never let tooling commit.","solutions":["Run the exact `git commit ...` command printed in the error — the files are already staged","If the underlying error was missing identity: git config --global user.name 'Your Name' and user.email, then run the recovery commit","If a hook rejected it, read the hook output and fix or consciously bypass with --no-verify before committing","Verify afterwards with `git log -1` and `git status`"],"exampleFix":"git config --global user.name 'Your Name'\ngit config --global user.email 'you@example.com'\ngit commit -m \"chore: auto-update system files to v1.9.0\"","handlingStrategy":"validation","validationCode":"import { execSync } from 'child_process';\nconst hasIdentity = (() => { try { execSync('git config user.email', { stdio: 'pipe' }); return true; } catch { return false; } })();\nif (!hasIdentity) throw new Error('configure git user.name and user.email before running the updater');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure git identity on every new machine/CI runner before first update","Keep pre-commit hooks from blocking automated maintenance commits (or allowlist them)","Expect one 'chore: auto-update system files' commit per update in your history"],"tags":["git","commit","updater","recovery"],"backgroundTag":"git-commit-failed","analyzedSha":"e7abd431fce9348a95261acac9e0c14779c35df8","analyzedAt":"2026-08-20T23:00:06.764Z","contentChangedAt":"2026-08-20T23:00:06.764Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}