Skip to content

Commit adc689d

Browse files
committed
issue 6 done
1 parent 652d4d1 commit adc689d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git_logger.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
EMPTY_FIELD = 'Empty field'
55

6-
76
def login(token):
87
client = Github(login_or_token=token)
98
try:
@@ -32,7 +31,7 @@ def get_next_repo(client: Github, repositories):
3231

3332

3433
def log_commit_to_csv(info, csv_name):
35-
fieldnames = ['repository name', 'author name', 'author login', 'author email', 'date and time', 'changed files']
34+
fieldnames = ['repository name', 'commit id', 'author name', 'author login', 'author email', 'date and time', 'changed files']
3635
with open(csv_name, 'a', newline='') as file:
3736
writer = csv.DictWriter(file, fieldnames=fieldnames)
3837
writer.writerow(info)
@@ -46,6 +45,7 @@ def log_repository_commits(repository: Repository, csv_name):
4645
for commit in repository.get_commits():
4746
if commit.commit is not None:
4847
info = {'repository name': repository.full_name,
48+
'commit id': commit.commit.sha,
4949
'author name': commit.commit.author.name,
5050
'author login': EMPTY_FIELD,
5151
'author email': EMPTY_FIELD,
@@ -244,6 +244,7 @@ def log_commits(client: Github, repositories, csv_name):
244244
writer.writerow(
245245
(
246246
'repository name',
247+
'commit id',
247248
'author name',
248249
'author login',
249250
'author email',

0 commit comments

Comments
 (0)