I am trying to find the coding days(active days) along with number of commits and each commit's size per coding days. This is what I meant to say
{
"2014-05-2": {
"commit_count": "1",
"commit": [{ 'commit_hash': {'lines_added': 10, 'lines_removed': 4 }}]
},
"2014-05-3": {
"commit_count": "2",
"commit": [
{ 'commit_hash': {'lines_added': 10, 'lines_removed': 4 }},
{ 'commit_hash': {'lines_added': 14, 'lines_removed': 0 }},
]
}
}
For now, I could only find coding days and number of commits this way
async def get_coding_days(self, author, before, after):
cmd = (
f'git log {self.conf.get("branch", "master")} --author="{author}" --date=short'
)
cmd += ' --pretty=format:"%ad %an"'
if before:
cmd += f' --before="{before}"'
if after:
cmd += f' --after="{after}"'
results = get_proc_out([cmd, "sort", "uniq -c"]).splitlines()
np_results = np.array(results)
stripped_array = np.char.strip(np_results)
for result in stripped_array:
second_space_pos = result.find(" ", 2)
if second_space_pos > 2:
count_with_time = result[0 : second_space_pos - 1]
[commit_count, coding_day] = count_with_time.split(" ")
author = result[second_space_pos + 1 :]
# default_dict[author].append(
# {"commit_count": commit_count, "coding_day": coding_day}
# )
if author not in self.coding_days:
self.coding_days[author] = []
self.coding_days[author].append(
{coding_day: {"commit_count": commit_count}}
)
return self.coding_days
How can I show commit size for each commit?