mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
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>
This commit is contained in:
committed by
chrome-bot
parent
b60d19198a
commit
4b10eb6c09
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user