2018-10-26 17:43:50 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-11-01 14:07:14 +00:00
|
|
|
set -x
|
|
|
|
|
2018-10-26 17:43:50 +00:00
|
|
|
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
|
|
|
|
CONTRIBUTORS_FILE=${CONTRIBUTORS_FILE=$CUR_DIR/StorageSystemContributors.generated.cpp}
|
|
|
|
|
2018-11-01 18:01:10 +00:00
|
|
|
git shortlog --summary | perl -lnE 's/^\s+\d+\s+(.+)/ "$1",/; next unless $1; say $_' > $CONTRIBUTORS_FILE.tmp
|
2018-10-26 17:43:50 +00:00
|
|
|
|
|
|
|
# If git history not available - dont make target file
|
|
|
|
if [ ! -s $CONTRIBUTORS_FILE.tmp ]; then
|
2018-11-01 14:07:14 +00:00
|
|
|
echo Empty result of git shortlog
|
|
|
|
git status
|
2018-10-26 17:43:50 +00:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "// autogenerated by $0" > $CONTRIBUTORS_FILE
|
|
|
|
echo "const char * auto_contributors[] {" >> $CONTRIBUTORS_FILE
|
|
|
|
cat $CONTRIBUTORS_FILE.tmp >> $CONTRIBUTORS_FILE
|
2018-11-01 18:01:10 +00:00
|
|
|
echo -e " nullptr};" >> $CONTRIBUTORS_FILE
|
2018-10-26 17:43:50 +00:00
|
|
|
|
2018-11-01 14:07:14 +00:00
|
|
|
echo "Collected `cat $CONTRIBUTORS_FILE.tmp | wc -l` contributors."
|
2018-10-26 17:43:50 +00:00
|
|
|
rm $CONTRIBUTORS_FILE.tmp
|
2018-11-01 14:07:14 +00:00
|
|
|
|