Skip to content

Instantly share code, notes, and snippets.

@joecannatti
Last active August 29, 2015 14:21
Show Gist options
  • Save joecannatti/f50f71e8191e6bd1e256 to your computer and use it in GitHub Desktop.
Save joecannatti/f50f71e8191e6bd1e256 to your computer and use it in GitHub Desktop.
for i in `cat repo_list`; do git clone git@github.com:stitchfix/$i.git; done
mkdir logs
mkdir data
for app in $(find . -type d -maxdepth 1 -mindepth 1 | grep -v ".git" | sed 's/\.\///'); do dirs -c; pushd $app; parent=`dirs +1`; eval logpath=$parent/$app.log; git log --date=iso > $logpath; popd; done;
find . -name \*log -maxdepth 1 -exec mv '{}' logs \;
pushd logs
for i in `find . -name \*log`; do cat $i | egrep -v '^commit' | egrep -v '^Merge' | egrep -v '^$' | egrep -v '^\s+' | perl -0pe 's/(.*)\nDate: (.*)\n/$1,$2\n/g' | sed 's/^Author: //' | sed 's/,\s*/,/'| sed "s|$|,${i}|" | sed 's/\.\///' | sed 's/\.log//'; done > all_commits
popd
cp logs/all_commits data
cat all_commits | awk -F'<' '{print $2}' | sed s/\>// > all_commits_by_email
rm all_commits
awk -F, '{print $1}' all_commits_by_email | sort | uniq | sort > emails
#create identies file by copying emails and replacing with names
cat -n identities | sed "s/\s*//" | sed 's/\s/,/' > numbered_identities; mv numbered_identities identities
#create teams file
#add team ids to identities
cp ../repo_list apps
#add team ids to app
cat -n apps | sed "s/\s*//" | sed 's/\s/,/' > numbered_apps; mv numbered_apps apps
cat -n emails | sed "s/\s*//" | sed 's/\s/,/' > numbered_email; mv numbered_email emails
#add headers to all csvs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment