Skip to content

Commit b2f5571

Browse files
dschogitster
authored andcommitted
mingw: document the standard handle redirection
This feature has been in Git for Windows since v2.11.0(2), as an experimental option. Now it is considered mature, and it is high time to document it properly. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1a172e4 commit b2f5571

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Documentation/git.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,24 @@ of clones and fetches.
709709
the background which do not want to cause lock contention with
710710
other operations on the repository. Defaults to `1`.
711711

712+
`GIT_REDIRECT_STDIN`::
713+
`GIT_REDIRECT_STDOUT`::
714+
`GIT_REDIRECT_STDERR`::
715+
Windows-only: allow redirecting the standard input/output/error
716+
handles to paths specified by the environment variables. This is
717+
particularly useful in multi-threaded applications where the
718+
canonical way to pass standard handles via `CreateProcess()` is
719+
not an option because it would require the handles to be marked
720+
inheritable (and consequently *every* spawned process would
721+
inherit them, possibly blocking regular Git operations). The
722+
primary intended use case is to use named pipes for communication
723+
(e.g. `\\.\pipe\my-git-stdin-123`).
724+
+
725+
Two special values are supported: `off` will simply close the
726+
corresponding standard handle, and if `GIT_REDIRECT_STDERR` is
727+
`2>&1`, standard error will be redirected to the same handle as
728+
standard output.
729+
712730
Discussion[[Discussion]]
713731
------------------------
714732

0 commit comments

Comments
 (0)