Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit e3a7825

Browse files
committed
Provide a Windows version resource for the git executables.
Embeds the git version and description into the git executable thus implementing the request in issue #5. Acked-by: Heiko Voigt <[email protected]> Acked-by: Sebastian Schuberth <[email protected]> Acked-by: Johannes Schindelin <[email protected]> Signed-off-by: Pat Thoyts <[email protected]>
1 parent fa9e401 commit e3a7825

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@
229229
/cscope*
230230
*.obj
231231
*.lib
232+
*.res
232233
*.sln
233234
*.suo
234235
*.ncb

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,9 @@ ifneq (,$(findstring MINGW,$(uname_S)))
14431443
compat/win32/dirent.o
14441444
BASIC_LDFLAGS += -Wl,--large-address-aware
14451445
EXTLIBS += -lws2_32
1446+
GITLIBS += git.res
14461447
PTHREAD_LIBS =
1448+
RC = windres -O coff
14471449
X = .exe
14481450
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
14491451
ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
@@ -1963,6 +1965,7 @@ ifndef V
19631965
QUIET_MSGFMT = @echo ' ' MSGFMT $@;
19641966
QUIET_GCOV = @echo ' ' GCOV $@;
19651967
QUIET_SP = @echo ' ' SP $<;
1968+
QUIET_RC = @echo ' ' RC $@;
19661969
QUIET_SUBDIR0 = +@subdir=
19671970
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
19681971
$(MAKE) $(PRINT_DIR) -C $$subdir
@@ -2208,6 +2211,11 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
22082211
$(QUIET_GEN)$(cmd_munge_script) && \
22092212
mv $@+ $@
22102213

2214+
git.res: git.rc
2215+
$(QUIET_RC)$(RC) \
2216+
$(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst ., ,$(GIT_VERSION)))) \
2217+
-DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@
2218+
22112219
ifndef NO_PERL
22122220
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
22132221

@@ -2916,7 +2924,7 @@ profile-clean:
29162924
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
29172925

29182926
clean: profile-clean
2919-
$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
2927+
$(RM) *.o *.res block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
29202928
builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
29212929
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
29222930
$(RM) $(TEST_PROGRAMS)

git.rc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
1 VERSIONINFO
2+
FILEVERSION MAJOR,MINOR,PATCH,0
3+
PRODUCTVERSION MAJOR,MINOR,PATCH,0
4+
BEGIN
5+
BLOCK "StringFileInfo"
6+
BEGIN
7+
BLOCK "040904b0" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */
8+
BEGIN
9+
VALUE "CompanyName", "The Git Development Community\0"
10+
VALUE "FileDescription", "Git for Windows\0"
11+
VALUE "InternalName", "git\0"
12+
VALUE "OriginalFilename", "git.exe\0"
13+
VALUE "ProductName", "Git\0"
14+
VALUE "ProductVersion", GIT_VERSION "\0"
15+
END
16+
END
17+
18+
BLOCK "VarFileInfo"
19+
BEGIN
20+
VALUE "Translation", 0x409, 1200
21+
END
22+
END

0 commit comments

Comments
 (0)