only commit to git if the update is not the dry run
authorBenjamin Mako Hill <mako@atdot.cc>
Mon, 14 Nov 2011 21:20:01 +0000 (16:20 -0500)
committerBenjamin Mako Hill <mako@atdot.cc>
Mon, 14 Nov 2011 21:20:01 +0000 (16:20 -0500)
weekly-update.py

index ad6ef1a43095fce7926a0ef25d8562020cd9d90c..acfc17bb8c0d67a760467e6e197e1cf4f28e9ed1 100755 (executable)
@@ -25,8 +25,9 @@ with open('ledger', 'a') as f:
     f.write("\n")
     f.write(render.render_template('templates/ledger', date))
 
-subprocess.check_call(["git", "commit", "ledger",
-                       "-m", "Update for %s" % (date,)])
+if not dry_run:
+    subprocess.check_call(["git", "commit", "ledger",
+                           "-m", "Update for %s" % (date,)])
 
 debts = render.get_debts()
 punt = []

Benjamin Mako Hill || Want to submit a patch?