summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@google.com>2015-11-17 15:20:02 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-17 22:06:48 -0800
commit4b10eb6c09efd133f6ba2fcce6463cf8e925495c (patch)
tree67cdb10185d796822f35ba664070458db04b7611
parentb60d19198aaf0af2cbe92e9327e1eb09c52573f1 (diff)
downloadchrome-ec-4b10eb6c09efd133f6ba2fcce6463cf8e925495c.tar.gz
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 <shawnn@chromium.org> Change-Id: I4fb042d7a706fbb86897b3e383b3242602af242b Reviewed-on: https://chromium-review.googlesource.com/313022 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rwxr-xr-xutil/getversion.sh4
1 files 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