Skip to content

Commit

Permalink
Include time in log/show output.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Nov 9, 2016
1 parent e584adb commit 9d669cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dulwich/porcelain.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
from dulwich.objects import (
Commit,
Tag,
format_timezone,
parse_timezone,
pretty_format_tree_entry,
)
Expand Down Expand Up @@ -341,6 +342,11 @@ def print_commit(commit, decode, outstream=sys.stdout):
outstream.write("Author: " + decode(commit.author) + "\n")
if commit.author != commit.committer:
outstream.write("Committer: " + decode(commit.committer) + "\n")

time_tuple = time.gmtime(commit.author_time + commit.author_timezone)
time_str = time.strftime("%a %b %d %Y %H:%M:%S", time_tuple)
timezone_str = format_timezone(commit.author_timezone)
outstream.write("Date: " + time_str + " " + timezone_str + "\n")
outstream.write("\n")
outstream.write(decode(commit.message) + "\n")
outstream.write("\n")
Expand Down

0 comments on commit 9d669cb

Please sign in to comment.