mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 19:13:16 +08:00
Change get_git_commit to return full commit hash
This patch changes get_git_commit to always return the full hash. Since different git versions do not agree on the length of the abbreviated hash this made the length flaky. To make the length consistent change it to always be the full hash.
This commit is contained in:
parent
65b5dc900f
commit
49b6486dad
@ -13,7 +13,7 @@ if(GIT_FOUND)
|
||||
|
||||
# Fetch the commit HASH of head (short version) using rev-parse
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
OUTPUT_VARIABLE EXT_GIT_COMMIT_HASH
|
||||
RESULT_VARIABLE _revparse_RESULT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
@ -4,10 +4,11 @@
|
||||
-- Check what get_git_commit returns
|
||||
SELECT pg_typeof(commit_tag) AS commit_tag_type,
|
||||
pg_typeof(commit_hash) AS commit_hash_type,
|
||||
length(commit_hash) AS commit_hash_length,
|
||||
pg_typeof(commit_time) AS commit_time_type
|
||||
FROM _timescaledb_internal.get_git_commit();
|
||||
commit_tag_type | commit_hash_type | commit_time_type
|
||||
-----------------+------------------+--------------------------
|
||||
text | text | timestamp with time zone
|
||||
commit_tag_type | commit_hash_type | commit_hash_length | commit_time_type
|
||||
-----------------+------------------+--------------------+--------------------------
|
||||
text | text | 40 | timestamp with time zone
|
||||
(1 row)
|
||||
|
||||
|
@ -42,9 +42,7 @@ foreach(TEMPLATE_FILE ${TEST_TEMPLATES_SHARED})
|
||||
list(APPEND TEST_FILES_SHARED ${TEST_FILE})
|
||||
endforeach(TEMPLATE_FILE)
|
||||
|
||||
if(DEFINED EXT_GIT_COMMIT_TAG
|
||||
OR DEFINED EXT_GIT_COMMIT_HASH
|
||||
OR DEFINED EXT_GIT_COMMIT_TIME)
|
||||
if(DEFINED GIT_FOUND)
|
||||
list(APPEND TEST_FILES_SHARED build_info.sql)
|
||||
endif()
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
-- Check what get_git_commit returns
|
||||
SELECT pg_typeof(commit_tag) AS commit_tag_type,
|
||||
pg_typeof(commit_hash) AS commit_hash_type,
|
||||
length(commit_hash) AS commit_hash_length,
|
||||
pg_typeof(commit_time) AS commit_time_type
|
||||
FROM _timescaledb_internal.get_git_commit();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user