Bug 245255

Summary: [git-webkit] prepare-commit-msg does not work with --reedit-message and --reuse-message
Product: WebKit Reporter: Elliott Williams <emw>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 239082    

Description Elliott Williams 2022-09-15 16:36:17 PDT
These git-commit options allow you to use the commit message from a different commit, and optionally stop for editing. They allow you to "rewrite" a commit by resetting to `main`, staging new changes, then running `git commit --reedit-message "HEAD@{1}"` to make changes to the old commit message.

Our prepare-commit-msg hook completely overwrites the commit message staged by these options, making them unusable. It should preserve the original message, and only list modified files in the comment section below the message body.
Comment 1 Radar WebKit Bug Importer 2022-09-22 16:37:17 PDT
<rdar://problem/100300158>
Comment 2 Sam Sneddon [:gsnedders] 2023-05-15 14:14:18 PDT
This looks like it was fixed by Bug 255121, except when I just tried to do this I got:

gsnedders@gsnedders-marsha webkitpy % git commit -c b318aede1356
  Running status to find changed, added, or removed files.
  Reviewing diff to determine which lines changed.
  Extracting affected function names from source files.
  Change author: Sam Sneddon <gsnedders@apple.com>.
  Running status to find changed, added, or removed files.
  Reviewing diff to determine which lines changed.
  Extracting affected function names from source files.
  Change author: Abrar Rahman Protyasha <a_protyasha@apple.com>.

And it displayed the author and commit message of `main` rather than of `b318aede1356`.