Add more logging to updates

This commit is contained in:
Zeva Rose 2022-05-01 15:54:01 -06:00
parent 7e1f0735f4
commit 97928d1b86

View file

@ -59,6 +59,7 @@ def get_all_commands(module: ModuleType = jarvis.cogs) -> Dict[str, Callable]:
def get_git_changes(repo: git.Repo) -> dict:
"""Get all Git changes"""
logger.debug("Getting all git changes")
head = repo.head
current_hash = head.object.hexsha
tracking = head.tracking_branch()
@ -73,6 +74,7 @@ def get_git_changes(repo: git.Repo) -> dict:
file_changes[file] = {"insertions": 0, "deletions": 0, "lines": 0}
for k, v in stats.items():
file_changes[file][k] += v
logger.debug(f"Found {len(file_changes)} changed files")
table = Table(title="File Changes")
@ -94,6 +96,7 @@ def get_git_changes(repo: git.Repo) -> dict:
str(stats["deletions"]),
str(stats["lines"]),
)
logger.debug(f"{i_total} insertions, {d_total} deletions, {l_total} total")
table.add_row("Total", str(i_total), str(d_total), str(l_total))
return {