git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/5] rebase -m: fix --signoff with conflicts

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Apr 18, 2024, 13:14 UTC
Message-ID
<cover.1713445918.git.phillip.wood@dunelm.org.uk>
From: Phillip Wood <phillip.wood@dunelm.org.uk>

When rebasing with "--signoff" the commit created by "rebase --continue" after resolving conflicts or editing a commit fails to add the "Signed-off-by:" trailer. This happens because the message from the original commit is reused instead of the one that would have been used if the sequencer had not stopped for the user interaction. This series fixes that by introducing an strbuf to hold the message which we then write to rebase_path_message() when stopping for user interaction.

The patches are structured as follows:

Patches 1–3 add private "struct replay_ctx" to "struct replay_opts" and move the private members from the latter into the former. These changes are largely mechanical.

Patch 4 adds strbuf to "struct replay_ctx" to hold the commit message. This change is also largely mechanical.

Patch 5 fixes the bug by using the changes in patch 4 to write the correct message to disc when stopping for user interaction.

This series is based on a merge of 'maint' and 'pw/t3428-cleanup'. In principle it would be passible to avoid the refactoring in patches 1–3 and add a new member to "struct replay_opts" instead. However the changes in those patches are largely mechanical so should be low-risk and they pave the way for more improvements and bug fixes in the future.

base-commit: 7bd541c104a2e383dd250f5f8e514785c4cabbc0
Published-As: https://github.com/phillipwood/git/releases/tag/pw%2Frebase-fix-signoff%2Fv1
View-Changes-At: https://github.com/phillipwood/git/compare/7bd541c10...4c8f88437
Fetch-It-Via: git fetch https://github.com/phillipwood/git pw/rebase-fix-signoff/v1
Phillip Wood (5):
  sequencer: always free "struct replay_opts"
  sequencer: start removing private fields from public API
  sequencer: move current fixups to private context
  sequencer: store commit message in private context
  rebase -m: fix --signoff with conflicts
 sequencer.c               | 250 ++++++++++++++++++++++++--------------
 sequencer.h               |  11 +-
 t/t3428-rebase-signoff.sh |  96 ++++++++++++---
 t/t3434-rebase-i18n.sh    |   2 +-
 4 files changed, 243 insertions(+), 116 deletions(-)
base-commit: 7bd541c104a2e383dd250f5f8e514785c4cabbc0
-- 
2.44.0.661.ge68cfcc6c2f
Next: Phillip Wood
Message 1 of 10 in “rebase -m: fix --signoff with conflicts”
  1. 0/5 rebase -m: fix --signoff with conflictsPhillip Wood, Apr 18, 2024
  2. 1/5 sequencer: always free "struct replay_opts"Phillip Wood, Apr 18, 2024
  3. 2/5 sequencer: start removing private fields from public APIPhillip Wood, Apr 18, 2024
  4. Junio C HamanoApr 18, 2024
  5. 3/5 sequencer: move current fixups to private contextPhillip Wood, Apr 18, 2024
  6. Junio C HamanoApr 18, 2024
  7. 4/5 sequencer: store commit message in private contextPhillip Wood, Apr 18, 2024
  8. Junio C HamanoApr 18, 2024
  9. 5/5 rebase -m: fix --signoff with conflictsPhillip Wood, Apr 18, 2024
  10. Junio C HamanoApr 18, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.