#!/bin/bash

# Script to list RDO contributors in a period of time
# Usage:
#      list_contributors.sh <initial date> <final date> [--new]
# Dates format must be YYYY-MM-DD
# option '--new' makes to display only new contributors
# examples:
#      list_contributors.sh 2021-05-01 2021-10-15
#      list_contributors.sh 2021-05-01 2021-10-15 --new
#

FROM=$1
TO=$2
NEW=$3

if [ "$NEW" = "--new" ]; then
echo "New contributors in the period $FROM to $TO:"
curl -s "https://review.rdoproject.org/repoxplorer/api/v1/tops/authors/diff?pid=RDO&limit=1000&dfrom=$FROM&dto=$TO&dfromref=2018-04-10&dtoref=$FROM" | jq -r '.[].name'|sort -u 
else
echo -e "The full list of contributors in the period $FROM to $TO:"
curl -s "https://review.rdoproject.org/repoxplorer/api/v1/tops/authors/bycommits?pid=RDO&limit=1000&dfrom=$FROM&dto=$TO"|jq -S -r '.[].name'| sort -u
fi

Add a script to list RDO contributors in a period of time
Add a script to list RDO contributors in a period of time

As we take this information in every new release, let's get it into a
script at least for documentation purposes.

Change-Id: I521ceb9b2d6befde38416e248fbbabd970b47095
