Bug 241760 - prepare-commit-msg includes unstaged changes
Summary: prepare-commit-msg includes unstaged changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Matt Woodrow
URL:
Keywords: InRadar
Depends on:
Blocks: 239082
  Show dependency treegraph
 
Reported: 2022-06-19 13:37 PDT by Matt Woodrow
Modified: 2022-09-07 20:37 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Woodrow 2022-06-19 13:37:19 PDT
Creating a commit with some changes unstaged still results in those changes being included in the generated commit message.

I think we need to pass `--git-index` to `prepare-ChangeLog` in order to only create a commit message template from the staged files.
Comment 1 Radar WebKit Bug Importer 2022-06-26 13:38:12 PDT
<rdar://problem/95940276>
Comment 2 Matt Woodrow 2022-06-27 18:17:41 PDT
Somewhat relatedly, when using `git commit --amend` to edit a commit, the provided list of changed files (as # lines) only contains the newly modified files.

For my usage, it'd probably be easier if it just gave the full set of changes, so that I can replace the set in the existing commit message as a whole, rather than merging in line-by-line. I guess providing both would be the best of both worlds?
Comment 3 Matt Woodrow 2022-07-26 18:00:42 PDT
Pull request: https://github.com/WebKit/WebKit/pull/2764
Comment 4 EWS 2022-09-07 20:37:26 PDT
Committed 254260@main (b4f3e7d2afaf): <https://commits.webkit.org/254260@main>

Reviewed commits have been landed. Closing PR #2764 and removing active labels.