Last active
August 29, 2015 14:19
-
-
Save sergray/a7cf81e2061b0b591e8a to your computer and use it in GitHub Desktop.
Save commits from multiple GitHub pull requests into text files just in one bash line (requires Python flatdict)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ for p in NUM1 NUM2; do curl -H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token OAUTH-TOKEN" \ | |
https://api.github.com/repos/:ORG:/:REPO:/pulls/$p/commits | \ | |
python -c "from flatdict import FlatDict; import json, csv, sys; rows = json.load(sys.stdin); \ | |
writer = csv.DictWriter(sys.stdout, [u'commit:author:name', u'commit:author:date', u'commit:tree:sha', u'commit:message'], extrasaction='ignore', delimiter='\t'); writer.writerows(FlatDict(row) for row in rows)" \ | |
> GH-PR-$p.txt; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment