Skip to content

Instantly share code, notes, and snippets.

@burntcookie90
Last active February 23, 2021 03:51
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save burntcookie90/c12b786e44af0df74414286c35ee79d7 to your computer and use it in GitHub Desktop.
Save burntcookie90/c12b786e44af0df74414286c35ee79d7 to your computer and use it in GitHub Desktop.
runs linguist on ever commit since a date
#!/usr/bin/bash
for commit in $(git --no-pager log --reverse --after="2016-10-01T10:36:00-07:00" --pretty=format:%H)
do
echo $commit
git checkout $commit
#write linguist data to a file
echo "" >> ~/repo-linguist-report.txt
echo "commit: $commit" >> ~/repo-linguist-report.txt
github-linguist >> ~/repo-linguist-report.txt
#write commit dates to another file, because we're lazy
echo "commit: $commit" >> ~/repo-commit-dates.txt
git show -s --format=%ci $commit >> ~/repo-commit-dates.txt
done
@castorflex
Copy link

Nice quick idea, thanks :)

@nuhkoca
Copy link

nuhkoca commented Nov 11, 2019

A side note;

You need to first install github-linguist gem on your OS:

For MacOs;

sudo gem install github-linguist

@burntcookie90
Copy link
Author

correct, this is dependant on https://github.com/github/linguist#installation

@nuhkoca
Copy link

nuhkoca commented Nov 11, 2019

Thanks @burntcookie90

May I ask how to view such a chart for my project after executing this command? I executed it and it finished but I don't know what to do next.

@burntcookie90
Copy link
Author

@nuhkoca, sorry for the necro reply i totally missed your comment! We ended up just sticking the data in a google sheet and charting it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment