Skip to content

Instantly share code, notes, and snippets.

@mtholder
Created May 2, 2017 14:09
Show Gist options
  • Select an option

  • Save mtholder/7a4161bdfdd82252beb922c77a119d9f to your computer and use it in GitHub Desktop.

Select an option

Save mtholder/7a4161bdfdd82252beb922c77a119d9f to your computer and use it in GitHub Desktop.
get the unix timestamps (seconds since start of epoch) for every commit in phylesystem-1 that changes the # of studies
#!/bin/bash
git rev-list HEAD > commits.txt
prev_ns=0
for sha in $(cat commits.txt)
do
unix_time=$(git show -s --format=%at "${sha}")
git checkout $sha || exit
num_studies=$(find study -name "*.json" | wc -l)
if test $num_studies -ne $prev_ns
then
echo $unix_time $num_studies
fi
prev_ns=$num_studies
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment