From 801150d1feee884cb830bd53a9c4f3a8e921a569 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 03 2016 20:34:20 +0000 Subject: In the logged message, include the hash of the commit done --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index b682361..0e480f4 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -1368,9 +1368,9 @@ def log_commits_to_db(session, project, commits, gitdir): """ Log the given commits to the DB. """ repo_obj = PagureRepo(gitdir) - for commit in commits: + for commitid in commits: try: - commit = repo_obj[commit] + commit = repo_obj[commitid] except ValueError: continue @@ -1384,8 +1384,9 @@ def log_commits_to_db(session, project, commits, gitdir): arg = { 'user': author_obj.user if author_obj else commit.author.email, 'project': project.fullname, + 'commitid': commit.oid.hex, } - desc = '%(user)s committed on %(project)s' % arg + desc = '%(user)s committed on %(project)s#%(commitid)s' % arg log = model.PagureLog( user_id=author_obj.id if author_obj else None, user_email=commit.author.email if not author_obj else None,