Skip to content

Commit bb1ab2d

Browse files
committed
Merge branch 'j6t/mingw'
* j6t/mingw: (38 commits) compat/pread.c: Add a forward declaration to fix a warning Windows: Fix ntohl() related warnings about printf formatting Windows: TMP and TEMP environment variables specify a temporary directory. Windows: Make 'git help -a' work. Windows: Work around an oddity when a pipe with no reader is written to. Windows: Make the pager work. When installing, be prepared that template_dir may be relative. Windows: Use a relative default template_dir and ETC_GITCONFIG Windows: Compute the fallback for exec_path from the program invocation. Turn builtin_exec_path into a function. Windows: Use a customized struct stat that also has the st_blocks member. Windows: Add a custom implementation for utime(). Windows: Add a new lstat and fstat implementation based on Win32 API. Windows: Implement a custom spawnve(). Windows: Implement wrappers for gethostbyname(), socket(), and connect(). Windows: Work around incompatible sort and find. Windows: Implement asynchronous functions as threads. Windows: Disambiguate DOS style paths from SSH URLs. Windows: A rudimentary poll() emulation. Windows: Implement start_command(). ...
2 parents 7d3580d + 14086b0 commit bb1ab2d

26 files changed

+7633
-80
lines changed

Documentation/git.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ git so take care if using Cogito etc.
410410
'GIT_ALTERNATE_OBJECT_DIRECTORIES'::
411411
Due to the immutable nature of git objects, old objects can be
412412
archived into shared, read-only directories. This variable
413-
specifies a ":" separated list of git object directories which
414-
can be used to search for git objects. New objects will not be
415-
written to these directories.
413+
specifies a ":" separated (on Windows ";" separated) list
414+
of git object directories which can be used to search for git
415+
objects. New objects will not be written to these directories.
416416

417417
'GIT_DIR'::
418418
If the 'GIT_DIR' environment variable is set then it

Makefile

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ GITWEB_FAVICON = git-favicon.png
205205
GITWEB_SITE_HEADER =
206206
GITWEB_SITE_FOOTER =
207207

208-
export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
208+
export prefix bindir gitexecdir sharedir htmldir sysconfdir
209209

210210
CC = gcc
211211
AR = ar
@@ -273,11 +273,9 @@ EXTRA_PROGRAMS =
273273

274274
# ... and all the rest that could be moved out of bindir to gitexecdir
275275
PROGRAMS += $(EXTRA_PROGRAMS)
276-
PROGRAMS += git-daemon$X
277276
PROGRAMS += git-fast-import$X
278277
PROGRAMS += git-fetch-pack$X
279278
PROGRAMS += git-hash-object$X
280-
PROGRAMS += git-imap-send$X
281279
PROGRAMS += git-index-pack$X
282280
PROGRAMS += git-merge-index$X
283281
PROGRAMS += git-merge-tree$X
@@ -337,6 +335,7 @@ LIB_H += builtin.h
337335
LIB_H += cache.h
338336
LIB_H += cache-tree.h
339337
LIB_H += commit.h
338+
LIB_H += compat/mingw.h
340339
LIB_H += csum-file.h
341340
LIB_H += decorate.h
342341
LIB_H += delta.h
@@ -717,6 +716,36 @@ ifeq ($(uname_S),HP-UX)
717716
NO_HSTRERROR = YesPlease
718717
NO_SYS_SELECT_H = YesPlease
719718
endif
719+
ifneq (,$(findstring MINGW,$(uname_S)))
720+
NO_MMAP = YesPlease
721+
NO_PREAD = YesPlease
722+
NO_OPENSSL = YesPlease
723+
NO_CURL = YesPlease
724+
NO_SYMLINK_HEAD = YesPlease
725+
NO_IPV6 = YesPlease
726+
NO_SETENV = YesPlease
727+
NO_UNSETENV = YesPlease
728+
NO_STRCASESTR = YesPlease
729+
NO_STRLCPY = YesPlease
730+
NO_MEMMEM = YesPlease
731+
NEEDS_LIBICONV = YesPlease
732+
OLD_ICONV = YesPlease
733+
NO_C99_FORMAT = YesPlease
734+
NO_STRTOUMAX = YesPlease
735+
NO_MKDTEMP = YesPlease
736+
SNPRINTF_RETURNS_BOGUS = YesPlease
737+
NO_SVN_TESTS = YesPlease
738+
NO_PERL_MAKEMAKER = YesPlease
739+
NO_POSIX_ONLY_PROGRAMS = YesPlease
740+
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat
741+
COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
742+
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
743+
COMPAT_OBJS += compat/mingw.o compat/fnmatch.o compat/regex.o
744+
EXTLIBS += -lws2_32
745+
X = .exe
746+
template_dir = ../share/git-core/templates/
747+
ETC_GITCONFIG = ../etc/gitconfig
748+
endif
720749
ifneq (,$(findstring arm,$(uname_M)))
721750
ARM_SHA1 = YesPlease
722751
endif
@@ -777,6 +806,10 @@ ifdef ZLIB_PATH
777806
endif
778807
EXTLIBS += -lz
779808

809+
ifndef NO_POSIX_ONLY_PROGRAMS
810+
PROGRAMS += git-daemon$X
811+
PROGRAMS += git-imap-send$X
812+
endif
780813
ifndef NO_OPENSSL
781814
OPENSSL_LIBSSL = -lssl
782815
ifdef OPENSSLDIR
@@ -1268,6 +1301,13 @@ remove-dashes:
12681301

12691302
### Installation rules
12701303

1304+
ifeq ($(firstword $(subst /, ,$(template_dir))),..)
1305+
template_instdir = $(gitexecdir)/$(template_dir)
1306+
else
1307+
template_instdir = $(template_dir)
1308+
endif
1309+
export template_instdir
1310+
12711311
install: all
12721312
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
12731313
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'

cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ int safe_create_leading_directories_const(const char *path);
522522
char *enter_repo(char *path, int strict);
523523
static inline int is_absolute_path(const char *path)
524524
{
525-
return path[0] == '/';
525+
return path[0] == '/' || has_dos_drive_prefix(path);
526526
}
527527
const char *make_absolute_path(const char *path);
528528
const char *make_nonrelative_path(const char *path);

0 commit comments

Comments
 (0)