Commit d4f4d60
commit-graph: prepare for commit-graph chains
To prepare for a chain of commit-graph files, augment the
commit_graph struct to point to a base commit_graph. As we load
commits from the graph, we may actually want to read from a base
file according to the graph position.
The "graph position" of a commit is given by concatenating the
lexicographic commit orders from each of the commit-graph files in
the chain. This means that we must distinguish two values:
* lexicographic index : the position within the lexicographic
order in a single commit-graph file.
* graph position: the position within the concatenated order
of multiple commit-graph files
Given the lexicographic index of a commit in a graph, we can
compute the graph position by adding the number of commits in
the lower-level graphs. To find the lexicographic index of
a commit, we subtract the number of commits in lower-level graphs.
While here, change insert_parent_or_die() to take a uint32_t
position, as that is the type used by its only caller and that
makes more sense with the limits in the commit-graph format.
Signed-off-by: Derrick Stolee <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 890345a commit d4f4d60
2 files changed
Lines changed: 81 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
362 | 371 | | |
363 | 372 | | |
364 | | - | |
| 373 | + | |
365 | 374 | | |
366 | 375 | | |
367 | 376 | | |
| |||
371 | 380 | | |
372 | 381 | | |
373 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
374 | 403 | | |
375 | 404 | | |
376 | | - | |
| 405 | + | |
377 | 406 | | |
378 | 407 | | |
379 | 408 | | |
380 | 409 | | |
381 | 410 | | |
382 | | - | |
383 | | - | |
| 411 | + | |
| 412 | + | |
384 | 413 | | |
385 | | - | |
| 414 | + | |
386 | 415 | | |
387 | 416 | | |
388 | 417 | | |
| |||
392 | 421 | | |
393 | 422 | | |
394 | 423 | | |
395 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
396 | 432 | | |
397 | 433 | | |
398 | 434 | | |
| |||
405 | 441 | | |
406 | 442 | | |
407 | 443 | | |
408 | | - | |
| 444 | + | |
| 445 | + | |
409 | 446 | | |
410 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
411 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
412 | 463 | | |
413 | 464 | | |
414 | 465 | | |
| |||
452 | 503 | | |
453 | 504 | | |
454 | 505 | | |
455 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
456 | 518 | | |
457 | 519 | | |
458 | 520 | | |
| |||
492 | 554 | | |
493 | 555 | | |
494 | 556 | | |
495 | | - | |
496 | | - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
497 | 564 | | |
498 | 565 | | |
499 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
0 commit comments