Bug 27605 - Improve git workflow by populating commit messages with ChangeLog entries.
Summary: Improve git workflow by populating commit messages with ChangeLog entries.
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-07-23 08:14 PDT by Eli Fidler
Modified: 2009-07-24 14:18 PDT (History)
2 users (show)

See Also:


Attachments
patch to add --[no-]write option to prepare-ChangeLog to put new entries on stdout instead of modifiying ChangeLog files (7.70 KB, patch)
2009-07-23 08:27 PDT, Eli Fidler
no flags Details | Formatted Diff | Diff
revised patch to handle top-level changes properly (7.76 KB, patch)
2009-07-23 08:52 PDT, Eli Fidler
manyoso: review-
Details | Formatted Diff | Diff
updated patch to fix ChangeLog indentation (7.77 KB, patch)
2009-07-23 09:22 PDT, Eli Fidler
no flags Details | Formatted Diff | Diff
add new prepare-ChangeLog options to bash completion script (2.05 KB, patch)
2009-07-23 14:26 PDT, Eli Fidler
no flags Details | Formatted Diff | Diff
If the user doesn't modify the ChangeLog files in the git commit, use prepare-ChangeLog to populate the git commit message. (2.34 KB, patch)
2009-07-23 14:32 PDT, Eli Fidler
no flags Details | Formatted Diff | Diff
add git configuration option to disable populating commit message (2.88 KB, patch)
2009-07-24 13:42 PDT, Eli Fidler
manyoso: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Fidler 2009-07-23 08:14:45 PDT
For git users, especially those working on local branches, it would be very helpful to have the git commit messages in WebKit ChangeLog entry format. Keeping the ChangeLog entries in the git commits instead of modifying the actual ChangeLog files avoids many conflicts during development (especially when doing rebases).

My intention is that the ChangeLog files will be updated properly before the commits are pushed upstream, of course.

The change will involve modifying prepare-ChangeLog and commit-log-editor so that using the workflow in http://trac.webkit.org/wiki/UsingGitWithWebKit (specifically using commit-log-editor as the git core.editor) will work nicely.
Comment 1 Eli Fidler 2009-07-23 08:27:27 PDT
Created attachment 33330 [details]
patch to add --[no-]write option to prepare-ChangeLog to put new entries on stdout instead of modifiying ChangeLog files
Comment 2 Eli Fidler 2009-07-23 08:52:57 PDT
Created attachment 33334 [details]
revised patch to handle top-level changes properly
Comment 3 Adam Treat 2009-07-23 09:06:52 PDT
Comment on attachment 33334 [details]
revised patch to handle top-level changes properly

> diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
> index 26eae74..654f679 100644
> --- a/WebKitTools/ChangeLog
> +++ b/WebKitTools/ChangeLog
> @@ -1,3 +1,17 @@
> +2009-07-23  Eli Fidler  <eli.fidler@torchmobile.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Improve git workflow by populating commit messages with ChangeLog entries.
> +        https://bugs.webkit.org/show_bug.cgi?id=27605
> +
> +		add --[no-]write option to optionally output new ChangeLog entries to
> +		stdout instead of modifying ChangeLog files
> +
> +		fix Torch Mobile copyright

Please fix the indentation.

> -#   Add command line option to put the ChangeLog into a separate
> -#     file or just spew it out stdout.
> +#   Add command line option to put the ChangeLog into a separate file.

Hmm, so this functionality supposedly existed at one point...

> +    if ($prefixDir eq "top level") {
> +        $sortKey = "";
> +    } elsif ($prefixDir eq "Tools") {
> +        $sortKey = "-, just after top level";
> +    } elsif ($prefixDir eq "WebBrowser") {
> +        $sortKey = lc "WebKit, WebBrowser after";
> +    } elsif ($prefixDir eq "WebCore") {
> +        $sortKey = lc "WebFoundation, WebCore after";

I understand that this logic was taken from commit-log-editor.  It'd be nice for an explanation of where 'WebBrowser' and 'WebFoundation' come from, but I suspect only the Apple folks would be able to provide that.  Still, it is good to match commit-log-editor.

The patch looks good minus the minor nits above.  One semi-ugly thing is that prepare-ChangeLog also writes to stderr by default a bunch of verbosity.  It is not important for our use case, but perhaps a header or a line break should be written to stderr right before we write to stdout to separate the two.

r- for the ChangeLog above.

Cheers,
Adam
Comment 4 David Levin 2009-07-23 09:12:52 PDT
btw, if you feel so inspired, feel free to add your new option to WebKitTools/Scripts/webkit-tools-completion.sh
Comment 5 Eli Fidler 2009-07-23 09:22:03 PDT
Created attachment 33338 [details]
updated patch to fix ChangeLog indentation
Comment 6 Adam Treat 2009-07-23 09:33:33 PDT
First patch landed with r46270.
Comment 7 Eli Fidler 2009-07-23 14:26:05 PDT
Created attachment 33373 [details]
add new prepare-ChangeLog options to bash completion script
Comment 8 Eli Fidler 2009-07-23 14:32:26 PDT
Created attachment 33376 [details]
If the user doesn't modify the ChangeLog files in the git commit, use prepare-ChangeLog to populate the git commit message.
Comment 9 David Levin 2009-07-23 14:38:32 PDT
Comment on attachment 33373 [details]
add new prepare-ChangeLog options to bash completion script


> +complete -W "--bug --diff --git-commit --git-index --git-reviewer --help --no-update --open --update -d -h -o --write --no-write" prepare-ChangeLog

Believe it or not, these are actually all sorted, but this can be fixed on landing. :)
Comment 10 David Levin 2009-07-23 14:40:04 PDT
Comment on attachment 33338 [details]
updated patch to fix ChangeLog indentation

Clearing r+ since it was landed.
Comment 11 David Levin 2009-07-24 03:52:11 PDT
Comment on attachment 33373 [details]
add new prepare-ChangeLog options to bash completion script

Clearing r+.

Landed as http://trac.webkit.org/changeset/46349
Comment 12 Eli Fidler 2009-07-24 13:42:14 PDT
Created attachment 33469 [details]
add git configuration option to disable populating commit message
Comment 13 Adam Treat 2009-07-24 13:49:29 PDT
Comment on attachment 33469 [details]
add git configuration option to disable populating commit message

I think we should prepend 'webKit' to the git config name otherwise this is perfect.  The change can be made when landing...
Comment 14 Adam Treat 2009-07-24 14:18:45 PDT
Landed with r46375.  Closing bug as fixed now.