-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce GIT_EPOCH for getting SOURCE_DATE_EPOCH date in tarball
- Loading branch information
Showing
5 changed files
with
25 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$Format:%ct$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
GIT_METADATA_DIR := $(dir $(lastword $(MAKEFILE_LIST))) | ||
|
||
# Note: We arrange for .gitcommit to contain the (short) commit hash in | ||
# tarballs generated with git-archive(1) using .gitattributes. The git repo | ||
# will have this file in its unexpanded form tough, in which case we fall | ||
# back to calling git directly. | ||
|
||
TARBALL_GIT_REV := $(shell cat $(GIT_METADATA_DIR)/.gitcommit) | ||
ifeq ($(TARBALL_GIT_REV),$$Format:%h$$) | ||
GIT_REV := $(shell GIT_DIR=$(GIT_METADATA_DIR)/.git git rev-parse --short=9 HEAD || echo UNKNOWN) | ||
GIT_EPOCH = $(shell GIT_DIR=$(GIT_METADATA_DIR)/.git git show --format=%ct -q || echo 1640991600) | ||
#^ 1640991600 == 2022-01-01 00:00:00 | ||
else | ||
GIT_REV := $(TARBALL_GIT_REV) | ||
GIT_EPOCH = $(shell cat $(GIT_METADATA_DIR)/.gitepoch) | ||
endif |