graflo.cli.commit¶
Git-shaped verbs over a manifest's commit history.
Distinct from migrate-schema, which plans and executes changes against a
database. These record and replay changes to the manifest -- the contract
plane. Nothing here touches a backend.
The verbs are deliberately the ones a git user already knows: commit,
log, verify, checkout, merge, revert. Where the semantics
differ from git they differ visibly -- checkout replays from a base manifest
rather than restoring a snapshot, because a manifest history stores change sets,
not trees.
Attributes¶
logger = logging.getLogger(__name__)
module-attribute
¶
Classes¶
Functions:¶
checkout_cmd(commit_id, base_path, store, output_path)
¶
Reconstruct the manifest as of a commit (default: the head).
Source code in graflo/cli/commit.py
commit_cmd(from_path, to_path, label, onto, hints_path, store, as_root, dry)
¶
Record the change between two manifests as a commit.
Source code in graflo/cli/commit.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
commit_group()
¶
The verbs this module contributes to the graflo group.
Source code in graflo/cli/commit.py
log_cmd(store, graph)
¶
List the commit history, oldest first.
Source code in graflo/cli/commit.py
merge3_cmd(left, right, base_path, store, take, label, output_path, dry, plot_path, history_plot_path)
¶
Merge two commits, reconciling against their common ancestor.
Source code in graflo/cli/commit.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | |
rehash_cmd(store, dry)
¶
Recompute every commit id from the current op serialization.
A commit id is derived from its ops as serialized, so a release that renames an op field changes the id of every commit carrying that op -- and, through the parent chain, of every commit after it. This walks the history in topological order, recomputes each id against its already-rehashed parents, and rewrites the store. Trees are untouched: the ops still replay to the same manifests, only their names on disk move.
Source code in graflo/cli/commit.py
revert_cmd(commit_id, base_path, store, label, output_path, dry)
¶
Record a new commit undoing an earlier one.
History is append-only: undoing a change moves forward, it never edits what was recorded.
Source code in graflo/cli/commit.py
stamp_cmd(manifest_path, commit_id, store, output_path)
¶
Write the content address and lineage into a manifest's metadata.
Stamping is explicit rather than automatic because a manifest that stamps itself on every apply would disagree with itself about its own lineage.
Source code in graflo/cli/commit.py
verify_cmd(base_path, against_path, store)
¶
Replay every head, checking each recorded tree hash.