Git: merge drivers and after a merge
The merge drivers prevent merge damage in the store; when it happened anyway, here is the repair.
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 runningtkt's absolute path (IDE merges work);post-merge/post-rewrite/post-checkouthooks ingit rev-parse --git-path hooks(core.hooksPathcounts) 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 %Pwrites the per-key max and raises the shared counter (unlesssharedCounter: false; a non-counters side: exit 1, conflict).tkt git merge-reviewsmerges 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; runningtkt git installagain removes them.tkt doctorprintsmerge 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},nulloutside 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 addboth. 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, oneidorulid) andERR_ID_MISMATCH(anidthat is not the file name; decisions and milestones too):tkt ticket renumber SG-160 [SG-161]ortkt 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.yamlorcounters.jsonstops every command (doctor exits 4). resolve-conflictlists the files that still name the old id (they may have meant theirs) and never guesses. A decision without--splitonly 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,## Notesrecords the old id (tkt ticket movelikewise).tkt decision renumber:decision://D63, bareD63,doc://<view> › D63row aliases, other decisions' relationships,supersededByand inherited/droppedaffects, the review store; the views re-render.- A failure restores store and counter. No REST counterpart.
Commands on this page#
tkt git installSet up the merge drivers in the repo that holds the store, for every worktree at once→
tkt git uninstallRemove exactly what tkt git install added for this store: its attributes block, its hook blocks, and the merge.aitodo-* config once no store's block is left→
tkt ticket resolve-conflictSplit a ticket file git merge left with conflict markers into its two creations→
tkt decision resolve-conflictSplit a decision file git merge left with conflict markers into two decisions→
tkt ticket renumberGive a ticket a new id in its own group; every reference follows (any status)→