Skip to content

Commit

Permalink
Added support for number of lines changed for git logs (#557)
Browse files Browse the repository at this point in the history
Co-authored-by: Kelly Brazil <kellyjonbrazil@gmail.com>
Co-authored-by: kshatalov <kshatalov@citco.com>
  • Loading branch information
3 people committed May 14, 2024
1 parent 6af82fb commit 0faacb6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion jc/parsers/git_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,20 @@ def parse(
if line.startswith(' ') and 'changed, ' not in line:
# this is a file name
file_name = line.split('|')[0].strip()
file_list.append(file_name)
file_stats = line.split('|')[1].strip()
lines_changed_str = file_stats.split(' ')
lines_changed_count_str = lines_changed_str[0].strip()
lines_changed = 0
try:
lines_changed = int(lines_changed_count_str)
except:
#nothing to do
pass

file = {}
file["name"] = file_name
file["lines_changed"] = lines_changed
file_list.append(file)
continue

if line.startswith(' ') and 'changed, ' in line:
Expand Down

0 comments on commit 0faacb6

Please sign in to comment.