Fix lastrev invoking in non-git directory

This commit is contained in:
Nobuyoshi Nakada authored and Nobuyoshi Nakada committed 2026-10-16 02:57:48 +09:00
1 parent 3e77f97d38
commit 50608f224a
2 files changed
+8 -5
Notes: git 2026-10-15 17:58:25 +00:00

No files matched your search

+3 -3
View File
@@ -20,8 +20,8 @@ mflags = $(MFLAGS)
gnumake_recursive =
sequential = $(gnumake:yes=-sequential)
enable_shared = $(ENABLE_SHARED:no=)
yes_git = $(WITH_GIT:no=)
no_git = $(WITH_GIT:yes=)
yes_git = $(HAVE_GIT:no=)
no_git = $(HAVE_GIT:yes=)
UNICODE_VERSION = 17.0.0
UNICODE_EMOJI_VERSION_0 = $(UNICODE_VERSION)///
@@ -1360,7 +1360,7 @@ clean-build-tool:
$(srcdir)/revision.h$(no_git:no=~disabled~): $(REVISION_H)
REVISION_H_CMD = $(LASTREV) | $(IFCHANGE) --timestamp=.revision.time revision.h -
REVISION_H_CMD = $(LASTREV) $(srcdir) | $(IFCHANGE) --empty --timestamp=.revision.time revision.h -
$(REVISION_H)$(no_git:no=~disabled~):
$(Q) $(REVISION_H_CMD)
+5 -2
View File
@@ -60,8 +60,11 @@ shift $((OPTIND-1))
gitdir="${1-.}" head="${2-HEAD}"
branch=`${git} -C "${gitdir}" symbolic-ref --short "${head}" 2>/dev/null` || branch="$head"
set `${git} -C "${gitdir}" log -1 --no-show-signature "--abbrev=${width}" \
"--date=format-local:%FT%TZ %Y %m %d" "--format=%h %H %${date_type}" "${head}" --`
set _ `${git} -C "${gitdir}" log -1 --no-show-signature "--abbrev=${width}" \
"--date=format-local:%FT%TZ %Y %m %d" "--format=%h %H %${date_type}" "${head}" -- 2>/dev/null`
shift
[ -z ${1+set} ] && exit
echo "#define RUBY_REVISION \"$1\""
echo "#define RUBY_FULL_REVISION \"${2}\""