Skip to content

Instantly share code, notes, and snippets.

@kidpixo
Created August 7, 2015 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kidpixo/bb02133d8ad6dcb7135e to your computer and use it in GitHub Desktop.
Save kidpixo/bb02133d8ad6dcb7135e to your computer and use it in GitHub Desktop.
No Description
# ipythonic way
commits_list = ! git --no-pager log --reverse --oneline
commits = []
for i in commits_list:
sha1 = i.split(' ')[0]
print 'Commit SHA-1 value:',sha1
commits.append(sha1)
# pythonic way
path = '/Users/damo_ma/Downloads/github_rep/git_history_visualizer'
p = subprocess.Popen(['git -C '+path+' --no-pager log --reverse --oneline'], stdout=subprocess.PIPE, shell=True)
commits2 = [i.split(' ')[0] for i in iter(p.stdout.readline,'')]
print 'Eh'+30*'h'+'??'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment