df89
10.10.21 c4d692c98f3e06d39cf80bf8fa2035c2e398646b
commit | author | age
c4d692 1 import os.path
D 2
3 from rawcommit import RawCommit
4 from commit import Commit
5
6 def getCommitList(repo):
7     """returns a list of commits from a repository log"""
8     try:
9         stream = os.popen("git -C {} log --format=%B--SEP--%H--SEP--%d--END--".format(repo)) # formatted log
10     except:
11         raise ValueError("Not a valid git-repository!")
12     else:
13         gitLog = stream.read()
14         commitList = gitLog.split("--END--") # separation of individual commits
15         del commitList[-1] # deletes empty last element
16
17         rawCommitList = []
18         for commit in commitList: # convert every commit into Commit via RawCommit
19             rawCommitList.append(Commit(RawCommit(commit)))
20         return commitList