Commit c573851
sequencer: extract revert message formatting into shared function
The logic for formatting revert commit messages (handling "Revert" and
"Reapply" cases) is currently duplicated between sequencer.c and will be
needed by builtin/replay.c.
Extract this logic into a new sequencer_format_revert_header() function
that can be shared. The function handles both regular reverts ("Revert
"<subject>"") and revert-of-revert cases ("Reapply "<subject>"").
When an oid is provided, the function appends the full commit hash and
period; otherwise the caller should append the commit reference.
Update do_pick_commit() to use the new helper, eliminating code
duplication while preserving the special handling for commit_use_reference.
Signed-off-by: Siddharth Asthana <siddharthasthana31@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 864f55e commit c573851
2 files changed
Lines changed: 42 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2356 | 2356 | | |
2357 | 2357 | | |
2358 | 2358 | | |
2359 | | - | |
2360 | | - | |
2361 | 2359 | | |
2362 | 2360 | | |
2363 | 2361 | | |
2364 | 2362 | | |
2365 | 2363 | | |
2366 | 2364 | | |
2367 | 2365 | | |
2368 | | - | |
2369 | | - | |
2370 | | - | |
2371 | | - | |
2372 | | - | |
2373 | | - | |
2374 | | - | |
2375 | | - | |
2376 | | - | |
2377 | | - | |
| 2366 | + | |
2378 | 2367 | | |
2379 | | - | |
2380 | | - | |
2381 | | - | |
| 2368 | + | |
2382 | 2369 | | |
2383 | | - | |
2384 | 2370 | | |
2385 | 2371 | | |
2386 | 2372 | | |
| |||
5572 | 5558 | | |
5573 | 5559 | | |
5574 | 5560 | | |
| 5561 | + | |
| 5562 | + | |
| 5563 | + | |
| 5564 | + | |
| 5565 | + | |
| 5566 | + | |
| 5567 | + | |
| 5568 | + | |
| 5569 | + | |
| 5570 | + | |
| 5571 | + | |
| 5572 | + | |
| 5573 | + | |
| 5574 | + | |
| 5575 | + | |
| 5576 | + | |
| 5577 | + | |
| 5578 | + | |
| 5579 | + | |
| 5580 | + | |
| 5581 | + | |
| 5582 | + | |
| 5583 | + | |
| 5584 | + | |
| 5585 | + | |
| 5586 | + | |
| 5587 | + | |
| 5588 | + | |
| 5589 | + | |
5575 | 5590 | | |
5576 | 5591 | | |
5577 | 5592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
274 | 285 | | |
0 commit comments