Skip to content

Commit

Permalink
[Build] Diff from branch point
Browse files Browse the repository at this point in the history
Sometimes Jenkins posts [spurious reports of new classes being added](apache#2339 (comment)). I believe this stems from diffing the patch against `master`, as opposed to against `master...`, which starts from the commit the PR was branched from.

This patch fixes that behavior.

Author: Nicholas Chammas <[email protected]>

Closes apache#2512 from nchammas/diff-only-commits-ahead and squashes the following commits:

c065599 [Nicholas Chammas] comment typo fix
a453c67 [Nicholas Chammas] diff from branch point
  • Loading branch information
nchammas authored and pwendell committed Sep 24, 2014
1 parent 729952a commit c429126
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dev/run-tests-jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ function post_message () {
merge_note=" * This patch merges cleanly."

source_files=$(
git diff master --name-only \
git diff master... --name-only `# diff patch against master from branch point` \
| grep -v -e "\/test" `# ignore files in test directories` \
| grep -e "\.py$" -e "\.java$" -e "\.scala$" `# include only code files` \
| tr "\n" " "
)
new_public_classes=$(
git diff master ${source_files} `# diff this patch against master and...` \
git diff master... ${source_files} `# diff patch against master from branch point` \
| grep "^\+" `# filter in only added lines` \
| sed -r -e "s/^\+//g" `# remove the leading +` \
| grep -e "trait " -e "class " `# filter in lines with these key words` \
Expand Down

0 comments on commit c429126

Please sign in to comment.