Skip to content

Commit

Permalink
Provide a Windows version resource for the git executables.
Browse files Browse the repository at this point in the history
Embeds the git version and description into the git executable thus
implementing the request in issue msysgit#5.

Acked-by: Heiko Voigt <hvoigt@hvoigt.net>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  • Loading branch information
patthoyts committed May 29, 2013
1 parent 74d6bea commit 8a1c4de
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
/cscope*
*.obj
*.lib
*.res
*.sln
*.suo
*.ncb
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@ ifndef V
QUIET_MSGFMT = @echo ' ' MSGFMT $@;
QUIET_GCOV = @echo ' ' GCOV $@;
QUIET_SP = @echo ' ' SP $<;
QUIET_RC = @echo ' ' RC $@;
QUIET_SUBDIR0 = +@subdir=
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
$(MAKE) $(PRINT_DIR) -C $$subdir
Expand Down Expand Up @@ -1751,6 +1752,11 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
$(QUIET_GEN)$(cmd_munge_script) && \
mv $@+ $@

git.res: git.rc
$(QUIET_RC)$(RC) \
$(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst ., ,$(GIT_VERSION)))) \
-DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@

ifndef NO_PERL
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak

Expand Down Expand Up @@ -2449,7 +2455,7 @@ profile-clean:
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))

clean: profile-clean
$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
$(RM) *.o *.res block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
$(RM) $(TEST_PROGRAMS)
Expand Down
2 changes: 2 additions & 0 deletions config.mak.uname
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,9 @@ ifneq (,$(findstring MINGW,$(uname_S)))
compat/win32/dirent.o
BASIC_LDFLAGS += -Wl,--large-address-aware
EXTLIBS += -lws2_32
GITLIBS += git.res
PTHREAD_LIBS =
RC = windres -O coff
NATIVE_CRLF = YesPlease
X = .exe
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
Expand Down
22 changes: 22 additions & 0 deletions git.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1 VERSIONINFO
FILEVERSION MAJOR,MINOR,PATCH,0
PRODUCTVERSION MAJOR,MINOR,PATCH,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */
BEGIN
VALUE "CompanyName", "The Git Development Community\0"
VALUE "FileDescription", "Git for Windows\0"
VALUE "InternalName", "git\0"
VALUE "OriginalFilename", "git.exe\0"
VALUE "ProductName", "Git\0"
VALUE "ProductVersion", GIT_VERSION "\0"
END
END

BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

0 comments on commit 8a1c4de

Please sign in to comment.