@@ -18,10 +18,14 @@ def __eq__(self, other) -> bool:
18
18
19
19
20
20
class GitCommit (GitObject ):
21
- def __init__ (self , rev , title , body = "" ):
21
+ def __init__ (
22
+ self , rev , title , body : str = "" , author : str = "" , author_email : str = ""
23
+ ):
22
24
self .rev = rev .strip ()
23
25
self .title = title .strip ()
24
26
self .body = body .strip ()
27
+ self .author = author .strip ()
28
+ self .author_email = author_email .strip ()
25
29
26
30
@property
27
31
def message (self ):
@@ -59,7 +63,7 @@ def get_commits(
59
63
start : Optional [str ] = None ,
60
64
end : str = "HEAD" ,
61
65
* ,
62
- log_format : str = "%H%n%s%n%b" ,
66
+ log_format : str = "%H%n%s%n%an%n%ae%n% b" ,
63
67
delimiter : str = "----------commit-delimiter----------" ,
64
68
args : str = "" ,
65
69
) -> List [GitCommit ]:
@@ -79,11 +83,14 @@ def get_commits(
79
83
rev_and_commit = rev_and_commit .strip ()
80
84
if not rev_and_commit :
81
85
continue
82
- rev , title , * body_list = rev_and_commit .split ("\n " )
83
-
86
+ rev , title , author , author_email , * body_list = rev_and_commit .split ("\n " )
84
87
if rev_and_commit :
85
88
git_commit = GitCommit (
86
- rev = rev .strip (), title = title .strip (), body = "\n " .join (body_list ).strip ()
89
+ rev = rev .strip (),
90
+ title = title .strip (),
91
+ body = "\n " .join (body_list ).strip (),
92
+ author = author ,
93
+ author_email = author_email ,
87
94
)
88
95
git_commits .append (git_commit )
89
96
return git_commits
0 commit comments