Bug 16024

Summary: prepare-Changelog needs to use git repo-config if git config fails
Product: WebKit Reporter: Ryan Leavengood <leavengood>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: ddkilzer
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Try git config, then git repo-config if the first fails
ddkilzer: review-
Use exit status instead of regular expression ddkilzer: review+

Description Ryan Leavengood 2007-11-16 21:26:56 PST
It seems the git command to get configuration information has changed from config to repo-config recently. If someone runs the current prepare-Changelog with a newer git the ChangeLog gets two git error messages inserted instead of their name and email.

The attached patch fixes that. I am not a Perl programmer so bear with me, but it is a simple change and works for me. I hope git formatted patches are acceptable.
Comment 1 David Kilzer (:ddkilzer) 2007-11-16 21:30:50 PST
(In reply to comment #0)
> The attached patch fixes that. I am not a Perl programmer so bear with me, but
> it is a simple change and works for me. I hope git formatted patches are
> acceptable.

They are acceptable.  Please note the contribution guidelines here:

http://webkit.org/coding/contributing.html

Comment 2 Ryan Leavengood 2007-11-16 21:32:05 PST
Created attachment 17326 [details]
Try git config, then git repo-config if the first fails
Comment 3 David Kilzer (:ddkilzer) 2007-11-16 22:06:05 PST
Comment on attachment 17326 [details]
Try git config, then git repo-config if the first fails

>     my $result = `$GIT config $config`;
>+               if ($result =~ /is not a git-command/) {
>+                               $result = `$GIT repo-config $config`;
>+               }

I think it would be best to check the exit value of the backtick command instead of the error text:

if (($? >> 8) != 0) {

Also, please use the same indention rules as the rest of the script.

Please make these changes and repost.  Thanks!
Comment 4 Ryan Leavengood 2007-11-16 22:14:44 PST
Created attachment 17329 [details]
Use exit status instead of regular expression

I also converted the tabs to spaces, sorry about that.
Comment 5 David Kilzer (:ddkilzer) 2007-11-16 22:18:12 PST
Comment on attachment 17329 [details]
Use exit status instead of regular expression

r=me

Thanks!
Comment 6 David Kilzer (:ddkilzer) 2007-11-16 22:43:12 PST
Committed revision 27870.