Skip to content

Instantly share code, notes, and snippets.

@cwmanning
Created April 25, 2013 20:21
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 cwmanning/5462810 to your computer and use it in GitHub Desktop.
Save cwmanning/5462810 to your computer and use it in GitHub Desktop.
parse Git log info
from sh import git
#
# Command Being Run
# git --git-dir autodeploy_branchbuilder.git log --grep="Merge pull request #" release/2.0.. | grep "Merge pull request"
#
# Output Expected Sample
# Merge pull request #19 from GannettDigital/feature/update_conflicts
# Merge pull request #18 from GannettDigital/feature/bugsquash
# etc.
#
# Actual Output Sample
# 35
# 35
# etc.
#
for line in git('--git-dir', repo_dir, 'log', '--grep="Merge pull request #" | grep "Merge pull request"', _iter_noblock=True):
print line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment