Skip to content

Commit

Permalink
Makefile: use commit time for revision date (#3990)
Browse files Browse the repository at this point in the history
Author time might be an old timestamp, commit time is always
monotonically increasing and useful to identify a revision.

Signed-off-by: Eryu Guan <[email protected]>
  • Loading branch information
eryugey authored Aug 15, 2023
1 parent 05176f1 commit 377ad82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export GO111MODULE=on
all: juicefs

REVISION := $(shell git rev-parse --short HEAD 2>/dev/null)
REVISIONDATE := $(shell git log -1 --pretty=format:'%ad' --date short 2>/dev/null)
REVISIONDATE := $(shell git log -1 --pretty=format:'%cd' --date short 2>/dev/null)
PKG := github.com/juicedata/juicefs/pkg/version
LDFLAGS = -s -w
ifneq ($(strip $(REVISION)),) # Use git clone
Expand Down
2 changes: 1 addition & 1 deletion sdk/java/libjfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export GO111MODULE=on
LDFLAGS = -s -w

REVISION := $(shell git rev-parse --short HEAD 2>/dev/null)
REVISIONDATE := $(shell git log -1 --pretty=format:'%ad' --date short 2>/dev/null)
REVISIONDATE := $(shell git log -1 --pretty=format:'%cd' --date short 2>/dev/null)
PKG := github.com/juicedata/juicefs/pkg/version
LDFLAGS = -s -w
LDFLAGS += -X $(PKG).revision=$(REVISION) \
Expand Down

0 comments on commit 377ad82

Please sign in to comment.