Skip to content

Commit

Permalink
Update contributors.sh script not to count publish commits
Browse files Browse the repository at this point in the history
Whenever you run `./pants publish.jar ...` it can add multiple commits to the commit log of the form:

```
pants build committing publish data for push of org.pantsbuild#...
```

These aren't very useful for counting real contributions at the end of a release cycle, so let's exclude them from the count.

Testing Done:
I didn't run CI because this script doesn't get executed as a part of CI

Before:

```
$ build-support/bin/contributors.sh -s HEAD~30
  13 Eric Ayers
   4 Kris Wilson
   3 Stu Hood
   3 Chris Pesto
   2 Yi Cheng
   2 Garrett Malmquist
   1 Wolfram Arnold
   1 Bruno Bieth
   1 Benjy Weinberger
```

After:

```
build-support/bin/contributors.sh -s HEAD~30
   6 Eric Ayers
   4 Kris Wilson
   3 Stu Hood
   3 Chris Pesto
   2 Garrett Malmquist
   1 Yi Cheng
   1 Wolfram Arnold
   1 Bruno Bieth
   1 Benjy Weinberger
```

Reviewed at https://rbcommons.com/s/twitter/r/3946/
  • Loading branch information
ericzundel committed Jun 1, 2016
1 parent cb18f87 commit 4546b3b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions build-support/bin/contributors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ done
function contributors() {
range="${1:-HEAD}"

# Include all commits in range but exclude all commits from the imported zinc tree.
git log --use-mailmap --format=format:%aN ${range} ^imported_zinc_tree
# Include all commits in range but exclude:
# - all commits from the imported zinc tree.
# - commits that are from running the publish goal
git log --use-mailmap --format="format:%aN;%s" ${range} ^imported_zinc_tree \
| grep -v "pants build committing publish data" \
| sed -e 's/;.*$//'

}

if [[ -n "${since}" ]]; then
Expand Down

0 comments on commit 4546b3b

Please sign in to comment.