Skip to content

Commit

Permalink
Limited loaded commit messages to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
lovec741 authored Oct 13, 2024
1 parent 735576b commit 1b66898
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ def archive():
def info(repo: Repository):
logs = repo.logger.getLogs()
formatted_logs = []
for log in logs:
commit_hash = log[1].split()[0][1:]
try:
commit_msg, commit_author, commit_url = repo.get_commit_info(commit_hash)
formatted_commit_info = f"<a href='{commit_url}' target='_blank'>#{commit_hash}</a>: {commit_msg} (by {commit_author})"
except Exception as e:
for i, log in enumerate(logs):
if i < 10:
commit_hash = log[1].split()[0][1:]
try:
commit_msg, commit_author, commit_url = repo.get_commit_info(commit_hash)
formatted_commit_info = f"<a href='{commit_url}' target='_blank'>#{commit_hash}</a>: {commit_msg} (by {commit_author})"
except Exception as e:
formatted_commit_info = ''
else:
formatted_commit_info = ''
formatted_logs.append((log[0], log[1], log[2], formatted_commit_info))

Expand Down

0 comments on commit 1b66898

Please sign in to comment.