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

Commit 83f96d7

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 174dd17 commit 83f96d7

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
@@ -227,6 +227,7 @@
227227
/cscope*
228228
*.obj
229229
*.lib
230+
*.res
230231
*.sln
231232
*.suo
232233
*.ncb

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,9 @@ ifneq (,$(findstring MINGW,$(uname_S)))
14301430
compat/win32/dirent.o
14311431
BASIC_LDFLAGS += -Wl,--large-address-aware
14321432
EXTLIBS += -lws2_32
1433+
GITLIBS += git.res
14331434
PTHREAD_LIBS =
1435+
RC = windres -O coff
14341436
X = .exe
14351437
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
14361438
ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
@@ -1947,6 +1949,7 @@ ifndef V
19471949
QUIET_MSGFMT = @echo ' ' MSGFMT $@;
19481950
QUIET_GCOV = @echo ' ' GCOV $@;
19491951
QUIET_SP = @echo ' ' SP $<;
1952+
QUIET_RC = @echo ' ' RC $@;
19501953
QUIET_SUBDIR0 = +@subdir=
19511954
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
19521955
$(MAKE) $(PRINT_DIR) -C $$subdir
@@ -2192,6 +2195,11 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
21922195
$(QUIET_GEN)$(cmd_munge_script) && \
21932196
mv $@+ $@
21942197

2198+
git.res: git.rc
2199+
$(QUIET_RC)$(RC) \
2200+
$(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst ., ,$(GIT_VERSION)))) \
2201+
-DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@
2202+
21952203
ifndef NO_PERL
21962204
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
21972205

@@ -2877,7 +2885,7 @@ profile-clean:
28772885
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
28782886

28792887
clean: profile-clean
2880-
$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
2888+
$(RM) *.o *.res block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
28812889
builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
28822890
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
28832891
$(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)