Bug 16024 - prepare-Changelog needs to use git repo-config if git config fails
Summary: prepare-Changelog needs to use git repo-config if git config fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-16 21:26 PST by Ryan Leavengood
Modified: 2007-11-16 22:43 PST (History)
1 user (show)

See Also:


Attachments
Try git config, then git repo-config if the first fails (1.03 KB, patch)
2007-11-16 21:32 PST, Ryan Leavengood
ddkilzer: review-
Details | Formatted Diff | Diff
Use exit status instead of regular expression (991 bytes, patch)
2007-11-16 22:14 PST, Ryan Leavengood
ddkilzer: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.