Last active
December 21, 2015 11:49
-
-
Save erikvanzijst/6301400 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import requests, re, sys | |
from urllib import urlencode | |
refs = [(ref[0] == '^' and 'exclude' or 'include', re.sub(r'^\^', '', ref)) | |
for ref in sys.argv[2:]] | |
url = ('/2.0/repositories/%s/commits?%s' % (sys.argv[1], urlencode(refs))) | |
while url: | |
doc = requests.get('https://api.bitbucket.org' + url).json() | |
for cset in doc['values']: | |
print cset['hash'][:7], cset['message'].splitlines()[0] | |
url = doc.get('next') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Traverses the commits in a Bitbucket repo:
analogous to what
git log
would give: