WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
74681
[Refactoring] Remove all global variables from prepare-ChangeLog
https://bugs.webkit.org/show_bug.cgi?id=74681
Summary
[Refactoring] Remove all global variables from prepare-ChangeLog
Kentaro Hara
Reported
2011-12-15 20:53:48 PST
We are planning to write unit-tests for prepare-ChangeLog in a run-leaks_unittest manner. This bug is one of the incremental refactorings to remove all top-level code and global variables from prepare-ChangeLog. In this bug, we remove all the remaining global variables. Accurately, we make $mergeBase, $gitCommit and $gitIndex be used only through parameter passing.
Attachments
Patch
(11.36 KB, patch)
2011-12-15 21:01 PST
,
Kentaro Hara
no flags
Details
Formatted Diff
Diff
rebased patch
(11.84 KB, patch)
2011-12-15 23:15 PST
,
Kentaro Hara
rniwa
: review+
Details
Formatted Diff
Diff
patch for commit
(11.83 KB, patch)
2011-12-16 00:07 PST
,
Kentaro Hara
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Kentaro Hara
Comment 1
2011-12-15 21:01:24 PST
Created
attachment 119553
[details]
Patch
Kentaro Hara
Comment 2
2011-12-15 23:15:37 PST
Created
attachment 119573
[details]
rebased patch
Ryosuke Niwa
Comment 3
2011-12-15 23:47:11 PST
Comment on
attachment 119573
[details]
rebased patch View in context:
https://bugs.webkit.org/attachment.cgi?id=119573&action=review
> Tools/Scripts/prepare-ChangeLog:527 > + my $changedFilesString = "'" . join ("' '", @$changedFiles) . "'";
Nit: There is a space between join and (.
> Tools/Scripts/prepare-ChangeLog:1468 > - my @files = @_; > + my ($paths, $gitCommit, $gitIndex, $mergeBase) = @_;
Why are we taking $paths instead of @files here?
> Tools/Scripts/prepare-ChangeLog:1476 > + my $filesString = "\"" . join ("\" \"", keys %$paths) . "\"";
Ditto about the space between join and (. By the way, can you replace all these "\" \"" by '" "' to improve the readability?
Kentaro Hara
Comment 4
2011-12-16 00:07:27 PST
Created
attachment 119576
[details]
patch for commit
Kentaro Hara
Comment 5
2011-12-16 00:07:38 PST
Comment on
attachment 119573
[details]
rebased patch View in context:
https://bugs.webkit.org/attachment.cgi?id=119573&action=review
>> Tools/Scripts/prepare-ChangeLog:527 >> + my $changedFilesString = "'" . join ("' '", @$changedFiles) . "'"; > > Nit: There is a space between join and (.
Fixed it.
>> Tools/Scripts/prepare-ChangeLog:1468 >> + my ($paths, $gitCommit, $gitIndex, $mergeBase) = @_; > > Why are we taking $paths instead of @files here?
If we write my (@files, $gitCommit, $gitIndex, $mergeBase) = @_; then all @_ are assigned to @files, unfortunately. So possible options are statusCommand(keys %$paths, ...) sub statusCommand(\@$$$$) { my ($files, ...) = @_; ... = @$files; } or statusCommand($paths, ...) sub statusCommand($$$$$) { my ($paths, $gitCommit, $gitIndex, $mergeBase) = @_; ... = keys %$paths; } I think both are fine (and chose the latter without a strong reason).
>> Tools/Scripts/prepare-ChangeLog:1476 >> + my $filesString = "\"" . join ("\" \"", keys %$paths) . "\""; > > Ditto about the space between join and (. By the way, can you replace all these "\" \"" by '" "' to improve the readability?
Fixed it.
Ryosuke Niwa
Comment 6
2011-12-16 00:24:31 PST
(In reply to
comment #5
)
> I think both are fine (and chose the latter without a strong reason).
Yeah, either solution is fine. I just wanted to avoid us duplicating "keys %$paths".
WebKit Review Bot
Comment 7
2011-12-16 01:21:19 PST
Comment on
attachment 119576
[details]
patch for commit Clearing flags on attachment: 119576 Committed
r103046
: <
http://trac.webkit.org/changeset/103046
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug