Skip to content

Commit

Permalink
rustc: Print a smaller hash on -v
Browse files Browse the repository at this point in the history
The long hash just takes up space and you can discover the main hash through the
`rustc --version verbose` command.
  • Loading branch information
alexcrichton committed Jul 21, 2014
1 parent 1607064 commit a491551
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mk/docs.mk
Expand Up @@ -112,8 +112,8 @@ HTML_DEPS += doc/version_info.html
doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
$(wildcard $(D)/*.*) | doc/
@$(call E, version-info: $@)
$(Q)sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
$(CFG_VER_HASH) | head -c 8)/;\
$(Q)sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(\
CFG_SHORT_VER_HASH)/;\
s/STAMP/$(CFG_VER_HASH)/;" $< >$@

GENERATED += doc/version.tex doc/version_info.html
Expand Down
3 changes: 2 additions & 1 deletion mk/main.mk
Expand Up @@ -46,7 +46,8 @@ ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT))),)
ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),)
CFG_VER_DATE = $(shell git --git-dir='$(CFG_GIT_DIR)' log -1 --pretty=format:'%ci')
CFG_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR)' rev-parse HEAD)
CFG_VERSION += ($(CFG_VER_HASH) $(CFG_VER_DATE))
CFG_SHORT_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR)' rev-parse --short=9 HEAD)
CFG_VERSION += ($(CFG_SHORT_VER_HASH) $(CFG_VER_DATE))
endif
endif

Expand Down

0 comments on commit a491551

Please sign in to comment.