aitododocs Coming soonAutonomous delivery

Git: merge drivers and after a merge

Markdown

The merge drivers prevent merge damage in the store; when it happened anyway, here is the repair.

Guideabout 4 min5 commands
On this page

Merge drivers#

tkt git install stops .aitodo/counters.json and the review files from conflicting on every merge of parallel branches. It writes only local git settings, for every worktree at once (nothing to commit); tkt git uninstall removes exactly that. --dry-run only shows it. Run it again after moving tkt.

Details6 items
  • It writes: a marker block per store in $(git-common-dir)/info/attributes (not .gitattributes): <store>/.aitodo/counters.json merge=aitodo-counters, <store>/reviews/**/*.yaml merge=aitodo-reviews; git config merge.aitodo-*.driver = the running tkt's absolute path (IDE merges work); post-merge / post-rewrite / post-checkout hooks in git rev-parse --git-path hooks (core.hooksPath counts) running, in the merge's worktree, the full re-check: tkt index rebuild --quiet --workspace-dir "$(git rev-parse --show-toplevel)/<store>". After a merge of two branches that are each consistent it names the open reviews.

  • Foreign hooks are untouched; the line is printed (action: "manual"). Outside git: ERR_GIT_FAILED.

  • The drivers (git runs them): tkt git merge-counters %O %A %B %P writes the per-key max and raises the shared counter (unless sharedCounter: false; a non-counters side: exit 1, conflict). tkt git merge-reviews merges by record key.

  • An older install: the retired decision view's driver (merge=aitodo-view, merge.aitodo-view.*) and hook command (decision views refresh) may be left from it; running tkt git install again removes them. tkt doctor prints merge drivers: installed / not installed / reviews/**/*.yaml not covered / the retired decision-view driver is left in …. CLI only.

  • tkt git install --json: {dryRun, repo, store, attributes: {path, block, changed}, config, configChanged, hooks: [{path, action: create|update|unchanged|manual, line}], legacyRemoved}.

  • Doctor JSON: mergeDrivers ({installed, uncovered, stale, hint}, null outside git).

After a merge#

After a git merge, run tkt doctor: a store file with conflict markers is ERR_FILE_CONFLICT for every command (file and first marker line).

  • Two tickets, one id (two ULIDs): tkt ticket resolve-conflict tickets/SG-160.md [--as SG-161]: ours keeps the id, theirs gets the next free number, both get ## Notes; git add both. One ULID (two edits): ERR_SPLIT_REFUSED, resolve by hand.
  • Decisions (no ULID): tkt decision resolve-conflict decisions/D63.md --split [--as D64].
  • ERR_ID_DUPLICATE (two files, one id or ulid) and ERR_ID_MISMATCH (an id that is not the file name; decisions and milestones too): tkt ticket renumber SG-160 [SG-161] or tkt decision renumber D63 [D64].
  • All four: --dry-run (every file and field), --json, --yes; all or nothing.
Details5 items
  • With a conflicted file, list commands skip it and name it once on stderr, a single read fails, a conflicted .aitodo/config.yaml or counters.json stops every command (doctor exits 4).
  • resolve-conflict lists the files that still name the old id (they may have meant theirs) and never guesses. A decision without --split only shows both titles.
  • Duplicates: list commands keep the first file and warn.
  • tkt ticket renumber: a new id in its own group, any status; rewrites relationships, title and body mentions, milestone members and bodies, group/doc/gotcha bodies, decision origin/until/affects and bodies, the review store, dismiss lists; the ULID stays, ## Notes records the old id (tkt ticket move likewise). tkt decision renumber: decision://D63, bare D63, doc://<view> › D63 row aliases, other decisions' relationships, supersededBy and inherited/dropped affects, the review store; the views re-render.
  • A failure restores store and counter. No REST counterpart.

Commands on this page#

Generated from the registry: src/aitodo/api/selfdoc_entries/team.py, src/aitodo/api/selfdoc_entries/maint.py · team.git, maint.merge-damagev0.1.298