Just a few things that should get cleaned up here:
* You seem to be adding a commented-out line. That's usually not a good idea. If
the line should get removed, just remove it.
* You should check that the exist status of "git am" is zero.
* You don't need the extra quotation marks in the final call to "git commit". To
be precise, do this:
subprocess.Popen(['git', 'commit', '--allow-empty', '-m', commit_msg],
cwd=repo.repo_path)
instead of
subprocess.Popen(['git', 'commit', '--allow-empty', '-m', '"' + commit_msg +
'"'], cwd=repo.repo_path)
(The great thing about the subprocess module is that it handles all the escaping
for you. Adding quotation marks there, therefore, will add them literally to the
data that we use as the commit log message. By the way, this is a *totally super
awesome* thing about subprocess, that we can relax and not worry about escaping.
Life is grand when we have good tools.)
You're on the right track. Thanks for getting this far.! Can you fix those
things and resubmit it?
|