Skip to content

Commit 9092800

Browse files
committed
Allow the use of GIT_USE_COMMIT_DATE in settings to switch to using commit date rather than author date as the revision timestamp
1 parent cb39a69 commit 9092800

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

codespeed/commits/git.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,14 @@ def updaterepo(project, update=True):
4343
def getlogs(endrev, startrev):
4444
updaterepo(endrev.branch.project, update=False)
4545

46-
cmd = ["git", "log",
47-
# NULL separated values delimited by 0x1e record separators
48-
# See PRETTY FORMATS in git-log(1):
49-
'--format=format:%h%x00%H%x00%at%x00%an%x00%ae%x00%s%x00%b%x1e']
46+
# NULL separated values delimited by 0x1e record separators
47+
# See PRETTY FORMATS in git-log(1):
48+
if hasattr(settings, 'GIT_USE_COMMIT_DATE') and settings.GIT_USE_COMMIT_DATE:
49+
logfmt = '--format=format:%h%x00%H%x00%ct%x00%an%x00%ae%x00%s%x00%b%x1e'
50+
else:
51+
logfmt = '--format=format:%h%x00%H%x00%at%x00%an%x00%ae%x00%s%x00%b%x1e'
52+
53+
cmd = ["git", "log", logfmt]
5054

5155
if endrev.commitid != startrev.commitid:
5256
cmd.append("%s...%s" % (startrev.commitid, endrev.commitid))

0 commit comments

Comments
 (0)