git/compat
Johannes Schindelin 3f944424ac mingw: add experimental feature to redirect standard handles
Particularly when calling Git from applications, such as Visual Studio's
Team Explorer, it is important that stdin/stdout/stderr are closed
properly. However, when spawning processes on Windows, those handles
must be marked as inheritable if we want to use them, but that flag is a
global flag and may very well be used by other spawned processes which
then do not know to close those handles.

Let's introduce a set of environment variables (GIT_REDIRECT_STDIN and
friends) that specify paths to files, or even better, named pipes (which
are similar to Unix sockets) and that are used by the spawned Git
process.  This helps work around above-mentioned issue: those named
pipes will be opened in a non-inheritable way upon startup, and no
handles are passed around (and therefore no inherited handles need to be
closed by any spawned child).

This feature shipped with Git for Windows (marked as experimental) since
v2.11.0(2), so it has seen some serious testing in the meantime.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-02 11:19:41 +09:00
..
nedmalloc compat: move strdup(3) replacement to its own file 2016-09-07 10:41:45 -07:00
poll poll.c: always set revents, even if to zero 2017-09-29 18:33:22 +09:00
regex cleanup: fix possible overflow errors in binary search 2017-10-10 08:57:24 +09:00
vcbuild MSVC: use shipped headers instead of fallback definitions 2016-03-30 11:16:20 -07:00
win32 Win32: simplify loading of DLL functions 2017-09-26 11:02:49 +09:00
apple-common-crypto.h imap-send: use HMAC() function provided by OpenSSL 2016-04-08 11:45:47 -07:00
basename.c compat/basename.c: provide a dirname() compatibility function 2016-01-12 10:40:54 -08:00
bswap.h bswap: convert get_be16, get_be32 and put_be32 to inline functions 2017-07-17 14:54:15 -07:00
cygwin.c cygwin: allow pushing to UNC paths 2017-07-05 14:01:03 -07:00
cygwin.h cygwin: allow pushing to UNC paths 2017-07-05 14:01:03 -07:00
fopen.c git_fopen: fix a sparse 'not declared' warning 2017-05-26 12:33:55 +09:00
gmtime.c date: recognize bogus FreeBSD gmtime output 2014-04-01 14:39:04 -07:00
hstrerror.c compat/hstrerror: convert sprintf to snprintf 2015-09-25 10:18:18 -07:00
inet_ntop.c compat/inet_ntop: fix off-by-one in inet_ntop4 2015-09-25 10:18:18 -07:00
inet_pton.c Drop system includes from inet_pton/inet_ntop compatibility wrappers 2012-02-05 16:32:33 -08:00
memmem.c optimize compat/ memmem() 2009-03-02 18:28:06 -08:00
mingw.c mingw: add experimental feature to redirect standard handles 2017-11-02 11:19:41 +09:00
mingw.h Merge branch 'js/bs-is-a-dir-sep-on-windows' into maint 2017-06-05 09:03:15 +09:00
mkdir.c compat: some mkdir() do not like a slash at the end 2012-08-24 09:48:51 -07:00
mkdtemp.c Fix gitmkdtemp: correct test for mktemp() return value 2010-02-25 12:08:22 -08:00
mmap.c wrapper.c: add xpread() similar to xread() 2014-04-10 12:18:55 -07:00
msvc.c win32: use our own dirent.h 2010-11-23 16:06:50 -08:00
msvc.h MSVC: fix stat definition hell 2013-09-11 11:08:52 -07:00
obstack.c obstack.c: Fix some sparse warnings 2011-09-11 14:43:33 -07:00
obstack.h obstack: fix spelling of similar 2013-04-12 12:23:20 -07:00
pread.c Replacing the system call pread() with lseek()/xread()/lseek() sequence. 2007-01-09 16:40:40 -08:00
precompose_utf8.c config: don't include config.h by default 2017-06-15 12:56:22 -07:00
precompose_utf8.h probe_utf8_pathname_composition: use internal strbuf 2015-10-05 11:06:49 -07:00
qsort.c use st_add and st_mult for allocation size computation 2016-02-22 14:51:09 -08:00
qsort_s.c compat: add qsort_s() 2017-01-23 11:02:34 -08:00
setenv.c use st_add and st_mult for allocation size computation 2016-02-22 14:51:09 -08:00
sha1-chunked.c sha1: allow limiting the size of the data passed to SHA1_Update() 2015-11-05 10:35:11 -08:00
sha1-chunked.h sha1: allow limiting the size of the data passed to SHA1_Update() 2015-11-05 10:35:11 -08:00
snprintf.c MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more 2016-03-30 11:13:01 -07:00
stat.c compat: convert modes to use portable file type values 2014-12-04 11:58:36 -08:00
strcasestr.c Clean up compatibility definitions. 2005-12-05 15:50:29 -08:00
strdup.c compat: move strdup(3) replacement to its own file 2016-09-07 10:41:45 -07:00
strlcpy.c simplify inclusion of system header files. 2006-12-20 09:51:35 -08:00
strtoimax.c Add strtoimax() compatibility function. 2011-11-02 13:06:30 -07:00
strtoumax.c Add a compat/strtoumax.c for Solaris 8. 2007-02-19 18:20:30 -08:00
terminal.c strbuf: introduce strbuf_getline_{lf,nul}() 2016-01-15 10:12:51 -08:00
terminal.h add generic terminal prompt function 2011-12-12 16:09:38 -08:00
unsetenv.c Revert "compat/unsetenv.c: Fix a sparse warning" 2013-07-21 15:09:56 -07:00
win32.h mingw: rename WIN32 cpp macro to GIT_WINDOWS_NATIVE 2013-05-08 12:14:35 -07:00
win32mmap.c mmap(win32): avoid expensive fstat() call 2016-04-22 15:01:16 -07:00
winansi.c winansi: avoid buffer overrun 2017-05-08 12:18:19 +09:00