From 4b10eb6c09efd133f6ba2fcce6463cf8e925495c Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Tue, 17 Nov 2015 15:20:02 -0800 Subject: [PATCH] getversion: Use commit date for date stamp The git author date usually reflects the time a CL was first pushed to gerrit, not the time it lands to the tree. Therefore, the author date is misleading when used as a timestamp. Use the git commit date instead. BUG=chromium:554675 BRANCH=None TEST=Cherry-pick CL:293345 and verify date stamp is today, not last August. Signed-off-by: Shawn Nematbakhsh Change-Id: I4fb042d7a706fbb86897b3e383b3242602af242b Reviewed-on: https://chromium-review.googlesource.com/313022 Commit-Ready: Shawn N Tested-by: Shawn N Reviewed-by: Vincent Palatin --- util/getversion.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/getversion.sh b/util/getversion.sh index 8b32307a49..811abfdf47 100755 --- a/util/getversion.sh +++ b/util/getversion.sh @@ -58,7 +58,7 @@ if [ -n "$dirty" ]; then echo "/* Repo is dirty, using time of last compilation */" echo "#define DATE \"$(date '+%F %T')\"" else - echo "/* Repo is clean, use the author date of the last commit */" - gitdate=$(git log -1 --format='%ai' HEAD | cut -d ' ' -f '1 2') + echo "/* Repo is clean, use the commit date of the last commit */" + gitdate=$(git log -1 --format='%ci' HEAD | cut -d ' ' -f '1 2') echo "#define DATE \"${gitdate}\"" fi