Changeset 196097 in webkit
- Timestamp:
- Feb 3, 2016 4:35:33 PM (8 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r196093 r196097 1 2016-02-03 Brian Burg <bburg@apple.com> 2 3 git-add-reviewer should work when run from a subdirectory within the repository 4 https://bugs.webkit.org/show_bug.cgi?id=153842 5 6 Reviewed by David Kilzer. 7 8 There are two problems that needed to be fixed: 9 10 - We can't assume .git is in $PWD/.git 11 - We can't specify absolute paths to `git commit` 12 13 Fix these problems using the helpers in VCSUtils that were added to 14 fix this same issue for prepare-changeCogs. 15 16 * Scripts/VCSUtils.pm: Export gitDirectory() 17 * Scripts/git-add-reviewer: 18 (nonInteractive): Cache gitDirectory() result. 19 (addReviewer): 20 (commit): 21 (changeLogsForCommit): Make paths relative. 22 1 23 2016-02-03 Jer Noble <jer.noble@apple.com> 2 24 -
trunk/Tools/Scripts/VCSUtils.pm
r191900 r196097 61 61 &fixChangeLogPatch 62 62 &gitBranch 63 &gitDirectory 63 64 &gitTreeDirectory 64 65 &gitdiff2svndiff -
trunk/Tools/Scripts/git-add-reviewer
r190366 r196097 32 32 use IPC::Open2; 33 33 34 use FindBin; 35 use lib $FindBin::Bin; 36 use webkitdirs; 37 use VCSUtils; 38 34 39 my $defaultReviewer = "NOBODY"; 35 40 … … 82 87 ); 83 88 89 my $gitDirectory = gitDirectory(); 90 84 91 usage() if !$getOptionsResult || $showHelp; 85 92 … … 182 189 183 190 unless ((($commit eq $headCommit) or checkout($commit)) 184 # FIXME: We need to use $ENV{GIT_DIR}/.git/MERGE_MSG 185 && writeCommitMessageToFile(".git/MERGE_MSG") 191 && writeCommitMessageToFile("$gitDirectory/MERGE_MSG") 186 192 && addReviewer(%item) 187 193 && commit(1) … … 234 240 } 235 241 236 addReviewerToCommitMessage($item->{reviewer}, $item->{rubberstamp}, " .git/MERGE_MSG") or return fail();242 addReviewerToCommitMessage($item->{reviewer}, $item->{rubberstamp}, "$gitDirectory/MERGE_MSG") or return fail(); 237 243 238 244 return 1; … … 243 249 my ($amend) = @_; 244 250 245 my @command = qw(git commit -F .git/MERGE_MSG); 251 my @command = qw(git commit -F); 252 push @command, "$gitDirectory/MERGE_MSG"; 246 253 push @command, "--amend" if $amend; 247 254 my $result = system @command; … … 330 337 @files or return fail("Couldn't determine changed files for $commit."); 331 338 332 my @changeLogs = map { /^[ACMR]\s*(.*)/; $1} grep { /^[ACMR].*[^-]ChangeLog/ } @files;339 my @changeLogs = map { /^[ACMR]\s*(.*)/; makeFilePathRelative($1) } grep { /^[ACMR].*[^-]ChangeLog/ } @files; 333 340 return \@changeLogs; 334 341 }
Note: See TracChangeset
for help on using the changeset viewer.