| 5635 | } |
| 5636 | |
| 5637 | void sequencer_format_revert_message(struct repository *r, |
| 5638 | const char *subject, |
| 5639 | const struct commit *commit, |
| 5640 | const struct commit *parent, |
| 5641 | bool use_commit_reference, |
| 5642 | struct strbuf *message) |
| 5643 | { |
| 5644 | const char *orig_subject; |
| 5645 | |
| 5646 | if (use_commit_reference) { |
| 5647 | strbuf_commented_addf(message, comment_line_str, |
| 5648 | "*** SAY WHY WE ARE REVERTING ON THE TITLE LINE ***"); |
| 5649 | } else if (skip_prefix(subject, "Revert \"", &orig_subject) && |
| 5650 | /* |
| 5651 | * We don't touch pre-existing repeated reverts, because |
| 5652 | * theoretically these can be nested arbitrarily deeply, |
| 5653 | * thus requiring excessive complexity to deal with. |
| 5654 | */ |
| 5655 | !starts_with(orig_subject, "Revert \"")) { |
| 5656 | strbuf_addstr(message, "Reapply \""); |
| 5657 | strbuf_addstr(message, orig_subject); |
| 5658 | strbuf_addstr(message, "\n"); |
| 5659 | } else { |
| 5660 | strbuf_addstr(message, "Revert \""); |
| 5661 | strbuf_addstr(message, subject); |
| 5662 | strbuf_addstr(message, "\"\n"); |
| 5663 | } |
| 5664 | strbuf_addstr(message, "\nThis reverts commit "); |
| 5665 | refer_to_commit(r, message, commit, use_commit_reference); |
| 5666 | |
| 5667 | if (commit->parents && commit->parents->next) { |
| 5668 | strbuf_addstr(message, ", reversing\nchanges made to "); |
| 5669 | refer_to_commit(r, message, parent, use_commit_reference); |
| 5670 | } |
| 5671 | strbuf_addstr(message, ".\n"); |
| 5672 | } |
| 5673 | |
| 5674 | void append_signoff(struct strbuf *msgbuf, size_t ignore_footer, unsigned flag) |
| 5675 | { |
no test coverage detected