Skip to content

Commit

Permalink
[autorevision] Set VCS_MOST_RECENT_COMMIT_DATE to the date (ignore th…
Browse files Browse the repository at this point in the history
…e time)
  • Loading branch information
past-due committed Feb 25, 2020
1 parent b365213 commit 32dd042
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build_tools/autorevision
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ gitRepo() {
fi

# get the most recent commit date
VCS_MOST_RECENT_COMMIT_DATE="$(git log -1 --format=%cI)"
VCS_MOST_RECENT_COMMIT_YEAR="$(git log -1 --format=%cI | cut -d "-" -f1)"
VCS_MOST_RECENT_COMMIT_DATE="$(git log -1 --format=%cd --date=short)"
VCS_MOST_RECENT_COMMIT_YEAR="$(echo "${VCS_MOST_RECENT_COMMIT_DATE}" | cut -d "-" -f1)"
}

# For Travis-CI builds
Expand Down
6 changes: 3 additions & 3 deletions build_tools/autorevision.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ macro(_gitRepo)
endif()

# get the most recent commit date
# VCS_MOST_RECENT_COMMIT_DATE="$(git log -1 --format=%cI)"
execute_process( COMMAND ${GIT_EXECUTABLE} log -1 --format=%cI
# VCS_MOST_RECENT_COMMIT_DATE="$(git log -1 --format=%cd --date=short)"
execute_process( COMMAND ${GIT_EXECUTABLE} log -1 --format=%cd --date=short
WORKING_DIRECTORY "${_repo_top_directory}"
OUTPUT_VARIABLE VCS_MOST_RECENT_COMMIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
# VCS_MOST_RECENT_COMMIT_YEAR="$(git log -1 --format=%cI | cut -d "-" -f1)"
# VCS_MOST_RECENT_COMMIT_YEAR="$(git log -1 --format=%cd --date=short | cut -d "-" -f1)"
STRING(REGEX MATCH "^[^-]+" VCS_MOST_RECENT_COMMIT_YEAR "${VCS_MOST_RECENT_COMMIT_DATE}")

# cleanup
Expand Down

0 comments on commit 32dd042

Please sign in to comment.