Created
September 11, 2015 10:45
-
-
Save eralpkaraduman/66e7b6e89c5f7476ae60 to your computer and use it in GitHub Desktop.
dumps commit messages with dates in last week to a file with week number
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
import subprocess | |
from datetime import datetime | |
process = subprocess.Popen([ | |
"git", | |
"log", | |
"--after", "1 week ago", | |
"--author", "eralpkaraduman", | |
"--format=%cd%n%s%n", | |
"--reverse", | |
"--date=short" | |
], stdout=subprocess.PIPE, cwd='/Users/eralp/ios-dumb-app') | |
output = process.communicate()[0] | |
today = datetime.today() | |
week_num = today.strftime("%U") | |
file_name = "commits_week_"+week_num+".txt" | |
log_file = open(file_name,"w") | |
log_file.write(output) | |
log_file.close() | |
print "ok, see "+file_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment