Bug 26664 - Add a flag to prepare-ChangeLog to only check the git index
Summary: Add a flag to prepare-ChangeLog to only check the git index
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-23 15:35 PDT by Joe Mason
Modified: 2009-06-23 16:11 PDT (History)
2 users (show)

See Also:


Attachments
implement this flag (3.22 KB, patch)
2009-06-23 15:37 PDT, Joe Mason
no flags Details | Formatted Diff | Diff
same patch with updated copyright info (3.82 KB, patch)
2009-06-23 15:44 PDT, Joe Mason
manyoso: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Mason 2009-06-23 15:35:30 PDT
By default, prepare-ChangeLog has two modes when used with git: by default it looks at all changes in both the index and the working tree, and with the --git-commit switch it looks at all changes in a specific commit.

When preparing a new commit, the most useful thing to do is to look only at the changes in the index so that the ChangeLog entry exactly matches what's about to be checked in.  Changes that are in the working tree but not the index aren't part of this commit so they shouldn't usually go in the ChangeLog.

Workflow with this switch would be:

    Make code changes
    git add (list of affected files)
    prepare-ChangeLog --git-index
    edit ChangeLog entries
    git add (ChangeLog file)
    git commit -t /path/to/ChangeLog (and remove all entries but the first from the commit message)

(This should be added as a flag to avoid confusing people who are already used to the old behaviour.)
Comment 1 Joe Mason 2009-06-23 15:37:05 PDT
Created attachment 31747 [details]
implement this flag

This patch was created with this very process!
Comment 2 Joe Mason 2009-06-23 15:44:59 PDT
Created attachment 31748 [details]
same patch with updated copyright info
Comment 3 Adam Treat 2009-06-23 16:01:39 PDT
Comment on attachment 31748 [details]
same patch with updated copyright info

I'd also be open to '--git-cached' or '--git-staged' for the flag name.  But the first thing said under the documentation for 'git add' is, "git-add - Add file contents to the index."  Also, the main tutorial is full of references to the "index".  So I guess we'll go with that.
Comment 4 Adam Treat 2009-06-23 16:11:26 PDT
Landed with r45012.