<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/run-command.c, branch v1.7.0.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v1.7.0.5</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.7.0.5'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2010-03-08T08:36:02Z</updated>
<entry>
<title>Merge branch 'mw/maint-gcc-warns-unused-write' into maint</title>
<updated>2010-03-08T08:36:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-03-08T08:36:02Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6eb3adff9e3b4d37903c8a2e0e708049ad154617'/>
<id>urn:sha1:6eb3adff9e3b4d37903c8a2e0e708049ad154617</id>
<content type='text'>
* mw/maint-gcc-warns-unused-write:
  run-command.c: fix build warnings on Ubuntu
</content>
</entry>
<entry>
<title>run-command.c: fix build warnings on Ubuntu</title>
<updated>2010-03-04T06:47:24Z</updated>
<author>
<name>Michael Wookey</name>
<email>michaelwookey@gmail.com</email>
</author>
<published>2010-01-29T22:38:19Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=90ff12a86073e27c9f423a255a4da4314c28936d'/>
<id>urn:sha1:90ff12a86073e27c9f423a255a4da4314c28936d</id>
<content type='text'>
Building git on Ubuntu 9.10 warns that the return value of write(2)
isn't checked. These warnings were introduced in commits:

  2b541bf8 ("start_command: detect execvp failures early")
  a5487ddf ("start_command: report child process setup errors to the
parent's stderr")

GCC details:

  $ gcc --version
  gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1

Silence the warnings by reading (but not making use of) the return value
of write(2).

Signed-off-by: Michael Wookey &lt;michaelwookey@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sp/maint-push-sideband' into maint</title>
<updated>2010-03-03T06:54:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-03-03T06:54:50Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=a886ba2801cbe0a4d6bbc34714cb09996dbcc127'/>
<id>urn:sha1:a886ba2801cbe0a4d6bbc34714cb09996dbcc127</id>
<content type='text'>
* sp/maint-push-sideband:
  receive-pack: Send internal errors over side-band #2
  t5401: Use a bare repository for the remote peer
  receive-pack: Send hook output over side band #2
  receive-pack: Wrap status reports inside side-band-64k
  receive-pack: Refactor how capabilities are shown to the client
  send-pack: demultiplex a sideband stream with status data
  run-command: support custom fd-set in async
  run-command: Allow stderr to be a caller supplied pipe

Conflicts:
	builtin-receive-pack.c
	run-command.c
	t/t5401-update-hooks.sh
</content>
</entry>
<entry>
<title>run-command: support custom fd-set in async</title>
<updated>2010-02-06T04:57:22Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2010-02-05T20:57:38Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=ae6a5609c025d9ac79e54a3a052704e25d885314'/>
<id>urn:sha1:ae6a5609c025d9ac79e54a3a052704e25d885314</id>
<content type='text'>
This patch adds the possibility to supply a set of non-0 file
descriptors for async process communication instead of the
default-created pipe.

Additionally, we now support bi-directional communiction with the
async procedure, by giving the async function both read and write
file descriptors.

To retain compatiblity and similar "API feel" with start_command,
we require start_async callers to set .out = -1 to get a readable
file descriptor.  If either of .in or .out is 0, we supply no file
descriptor to the async process.

[sp: Note: Erik started this patch, and a huge bulk of it is
     his work.  All bugs were introduced later by Shawn.]

Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: Allow stderr to be a caller supplied pipe</title>
<updated>2010-02-06T04:57:16Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2010-02-05T20:57:37Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4f41b611481bad08319966f7787fc7c4c7bfaa52'/>
<id>urn:sha1:4f41b611481bad08319966f7787fc7c4c7bfaa52</id>
<content type='text'>
Like .out, .err may now be set to a file descriptor &gt; 0, which
is a writable pipe/socket/file that the child's stderr will be
redirected into.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/exec-error-report'</title>
<updated>2010-01-20T22:44:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-01-20T22:44:12Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=030b1a77f72a7e3307c7d7881ae570ca1c8ed877'/>
<id>urn:sha1:030b1a77f72a7e3307c7d7881ae570ca1c8ed877</id>
<content type='text'>
* js/exec-error-report:
  Improve error message when a transport helper was not found
  start_command: detect execvp failures early
  run-command: move wait_or_whine earlier
  start_command: report child process setup errors to the parent's stderr

Conflicts:
	Makefile
</content>
</entry>
<entry>
<title>Merge branch 'js/windows'</title>
<updated>2010-01-19T02:12:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-01-19T02:12:49Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=3cd02df46a56c5c006163e72d0816aef1ba4a00e'/>
<id>urn:sha1:3cd02df46a56c5c006163e72d0816aef1ba4a00e</id>
<content type='text'>
* js/windows:
  Do not use date.c:tm_to_time_t() from compat/mingw.c
  MSVC: Windows-native implementation for subset of Pthreads API
  MSVC: Fix an "incompatible pointer types" compiler warning
  Windows: avoid the "dup dance" when spawning a child process
  Windows: simplify the pipe(2) implementation
  Windows: boost startup by avoiding a static dependency on shell32.dll
  Windows: disable Python
</content>
</entry>
<entry>
<title>Windows: avoid the "dup dance" when spawning a child process</title>
<updated>2010-01-17T00:43:53Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2010-01-15T20:12:18Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=75301f90159a505f3683a5eba10174928dc30fb1'/>
<id>urn:sha1:75301f90159a505f3683a5eba10174928dc30fb1</id>
<content type='text'>
When stdin, stdout, or stderr must be redirected for a child process that
on Windows is spawned using one of the spawn() functions of Microsoft's
C runtime, then there is no choice other than to

1. make a backup copy of fd 0,1,2 with dup
2. dup2 the redirection source fd into 0,1,2
3. spawn
4. dup2 the backup back into 0,1,2
5. close the backup copy and the redirection source

We used this idiom as well -- but we are not using the spawn() functions
anymore!

Instead, we have our own implementation. We had hardcoded that stdin,
stdout, and stderr of the child process were inherited from the parent's
fds 0, 1, and 2. But we can actually specify any fd.

With this patch, the fds to inherit are passed from start_command()'s
WIN32 section to our spawn implementation. This way, we can avoid the
backup copies of the fds.

The backup copies were a bug waiting to surface: The OS handles underlying
the dup()ed fds were inherited by the child process (but were not
associated with a file descriptor in the child). Consequently, the file or
pipe represented by the OS handle remained open even after the backup copy
was closed in the parent process until the child exited.

Since our implementation of pipe() creates non-inheritable OS handles, we
still dup() file descriptors in start_command() because dup() happens to
create inheritable duplicates. (A nice side effect is that the fd cleanup
in start_command is the same for Windows and Unix and remains unchanged.)

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>start_command: detect execvp failures early</title>
<updated>2010-01-10T18:15:03Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2010-01-10T13:11:22Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=2b541bf8be2bbd6cc8daf8e3d5d4a8ee30b2ce4e'/>
<id>urn:sha1:2b541bf8be2bbd6cc8daf8e3d5d4a8ee30b2ce4e</id>
<content type='text'>
Previously, failures during execvp could be detected only by
finish_command. However, in some situations it is beneficial for the
parent process to know earlier that the child process will not run.

The idea to use a pipe to signal failures to the parent process and
the test case were lifted from patches by Ilari Liusvaara.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: move wait_or_whine earlier</title>
<updated>2010-01-10T18:05:52Z</updated>
<author>
<name>Johannes Sixt</name>
<email>j6t@kdbg.org</email>
</author>
<published>2010-01-10T13:08:45Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=ab0b41daf62ec3076e980fcad492b1997b35f22b'/>
<id>urn:sha1:ab0b41daf62ec3076e980fcad492b1997b35f22b</id>
<content type='text'>
We want to reuse it from start_command.

Signed-off-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
