원클릭으로
resolving-rebase-conflicts
Resolve rebase conflicts in Ent generated code and Atlas migrations using repository scripts.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Resolve rebase conflicts in Ent generated code and Atlas migrations using repository scripts.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | resolving-rebase-conflicts |
| description | Resolve rebase conflicts in Ent generated code and Atlas migrations using repository scripts. |
Activate this skill when any of these conditions are detected:
git rebase or gt restack and atlas.sum has conflict markersatlas.sum conflictsgit status shows atlas.sum as "both modified" or migration .sql files with conflictsspark/so/ent/ have conflict markers after rebasego build or go generate fails due to conflict markers in ent-generated codeSymptom: atlas.sum has conflict markers, but ent-generated .go files are fine. The base branch added migrations for schemas unrelated to yours - only ordering conflicts.
Fix: mise fix-atlas-conflicts
Symptom: Generated ent .go files in spark/so/ent/ have conflict markers (<<<<<<</>>>>>>>). Go compilation fails, so go generate can't run. If this commit also added atlas migrations, those migrations are invalid (generated against pre-rebase schema state).
Fix: mise fix-ent-conflicts
The repository includes scripts/fix-atlas-conflicts.sh (also available as mise fix-atlas-conflicts) which automates the fix:
.sql files added by the rebasing commit (via REBASE_HEAD)atlas.sum from scratch using atlas migrate hashPreview the fix (always do this first):
mise fix-atlas-conflicts -- --dry-run
This shows which files will be renamed and to what timestamps, without making changes.
Apply the fix:
mise fix-atlas-conflicts
Continue the rebase. The script will suggest the correct command:
gt on PATH and .graphite/ exists): gt continuegit rebase --continuemise fix-atlas-conflicts -- --commit <SHA> to specify the commit manuallyThe repository includes scripts/fix-ent-conflicts.sh (also available as mise fix-ent-conflicts) which automates the fix:
.go files for conflict markers in hand-written files (any file without the Code generated by ent header).go files by scanning for the // Code generated by ent, DO NOT EDIT. header--ours) version via git checkout --ours. This removes conflict markers while keeping valid, type-checkable Go - necessary because ent's codegen parses schemas that import from generated packagesgo generate ./so/ent/... to regenerate from the merged schemas.sql files, deletes them (they're stale) and rehashes atlas.sumResolve conflicts in hand-written files first. The script will abort if it finds conflict markers in any .go file that lacks the Code generated by ent header (schemas, extensions, tests, config files, etc.).
Preview the fix:
mise fix-ent-conflicts -- --dry-run
Apply the fix:
mise fix-ent-conflicts
If the script deleted stale migrations, regenerate them:
./scripts/gen-migration.sh <migration-name>
Continue the rebase. The script will suggest the correct command.
--dry-run - Preview which files would be reset, without making changes--force - Skip generated-file conflict-marker check (useful outside a rebase, e.g. after manual schema merge)-h/--help - Usage informationThe script detects generated files by their // Code generated by ent, DO NOT EDIT. header. Any .go file without this header is treated as hand-written and left untouched. Examples:
| File | Why |
|---|---|
ent/schema/** | Schema definitions, mixins, schematype/ |
ent/*_extension.go | Hand-written extension files |
ent/*_ext.go | Hand-written predicate extensions |
ent/*_test.go | Test files |
ent/entc.go | Codegen driver config |
ent/generate.go | //go:generate directive |
ent/interceptor.go | Custom OpenTelemetry interceptors |
ent/telemetry.go | Custom tracer init |
ent/migrate/dump_schema.go | Hand-written schema dump utility |
ent/migrate/migrations/** | Migration SQL files + atlas.sum |
atlas.sum conflict markers - the hash file is regenerated from scratchatlas.sumgit checkout --theirs atlas.sum - this loses the entry for our migration filesfix-ent-conflicts for atlas-only conflicts - use fix-atlas-conflicts instead