From 889c59909de441f49370d9639e95ae8197d15921 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 09 2014 15:17:47 +0000 Subject: Fix the format and the date exposed in the patch output With these changes ``git am`` works out of the box --- diff --git a/progit/repo.py b/progit/repo.py index ffb87bb..e144c9b 100644 --- a/progit/repo.py +++ b/progit/repo.py @@ -421,7 +421,7 @@ def view_commit_patch(repo, commitid, username=None): # First commit in the repo diff = commit.tree.diff_to_tree(swap=True) - patch = """commit %(commit)s + patch = """From %(commit)s From: %(author_name)s <%(author_email)s> Date: %(date)s @@ -433,8 +433,8 @@ Date: %(date)s 'commit': commit.oid.hex, 'author_name': commit.author.name, 'author_email': commit.author.email, - 'date': datetime.datetime.fromtimestamp( - commit.commit_time).strftime('%b %d %Y %H:%M:%S'), + 'date': datetime.datetime.utcfromtimestamp( + commit.commit_time).strftime('%b %d %Y %H:%M:%S +0000'), 'msg': commit.message, 'patch': diff.patch, }