Skip to content

Instantly share code, notes, and snippets.

@khatribharat
Forked from pwendell/commits.sh
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khatribharat/e3a187f8a4c170a44764 to your computer and use it in GitHub Desktop.
Save khatribharat/e3a187f8a4c170a44764 to your computer and use it in GitHub Desktop.
# How to re-create commit activity graphs for YARN, MapReduce, HDFS, and Spark.
# This example shows the last 60 days of activity.
git clone https://github.com/apache/hadoop-common.git
cd hadoop-common
# MapReduce (commits, inserted, deleted)
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep MAPREDUCE | grep insertion | wc
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep MAPREDUCE | grep insertion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep MAPREDUCE | grep deletion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
# HDFS (commits, inserted, deleted)
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep HDFS | grep insertion | wc
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep HDFS | grep insertion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep HDFS | grep deletion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
# YARN (commits, inserted, deleted)
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep YARN | grep insertion | wc
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep YARN | grep insertion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
git log --since="60 days ago" --pretty=format:"%h:" --shortstat --grep YARN | grep deletion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
# Spark (commits, inserted, deleted)
git clone https://github.com/apache/spark.git
cd spark
git log --since="60 days ago" --pretty=format:"%h:" --shortstat | grep insertion | wc
git log --since="60 days ago" --pretty=format:"%h:" --shortstat | grep insertion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
git log --since="60 days ago" --pretty=format:"%h:" --shortstat | grep deletion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
# Storm (commits, inserted, deleted)
git clone https://github.com/apache/incubator-storm.git
cd incubator-storm
git log --since="60 days ago" --pretty=format:"%h:" --shortstat | grep insertion | wc
git log --since="60 days ago" --pretty=format:"%h:" --shortstat | grep insertion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
git log --since="60 days ago" --pretty=format:"%h:" --shortstat | grep deletion | cut -d " " -f 5 | perl -lne '$x += $_; END { print $x; }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment