Extract actual commits; handle errors
This commit is contained in:
parent
f3278ec1db
commit
cc72221ee2
1 changed files with 12 additions and 6 deletions
|
@ -45,11 +45,11 @@ def iter_commits(repo: str):
|
||||||
# TODO other branches?
|
# TODO other branches?
|
||||||
rr = basename(repo)
|
rr = basename(repo)
|
||||||
gr = git.Repo(repo)
|
gr = git.Repo(repo)
|
||||||
for c in gr.head.reference.log():
|
for c in gr.iter_commits():
|
||||||
if by_me(c.actor):
|
if by_me(c.author):
|
||||||
yield Commit(
|
yield Commit(
|
||||||
dt=c.time,
|
dt=c.committed_datetime, # TODO authored??
|
||||||
message=c.message, # TODO strip off 'commit: '? (there are also 'merge')
|
message=c.message.strip(),
|
||||||
repo=rr,
|
repo=rr,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -64,8 +64,14 @@ def iter_all_commits():
|
||||||
for d in listdir(src):
|
for d in listdir(src):
|
||||||
pr = join(src, d)
|
pr = join(src, d)
|
||||||
if is_git_repo(pr):
|
if is_git_repo(pr):
|
||||||
for c in iter_commits(pr):
|
try:
|
||||||
yield c
|
for c in iter_commits(pr):
|
||||||
|
yield c
|
||||||
|
except ValueError as ve:
|
||||||
|
if "Reference at 'refs/heads/master' does not exist" in str(ve):
|
||||||
|
continue # TODO wtf??? log?
|
||||||
|
else:
|
||||||
|
raise ve
|
||||||
|
|
||||||
|
|
||||||
def get_all_commits():
|
def get_all_commits():
|
||||||
|
|
Loading…
Add table
Reference in a new issue