<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/run-command.c, branch v1.5.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v1.5.2</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.5.2'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2007-03-13T06:40:17Z</updated>
<entry>
<title>Teach run-command to redirect stdout to /dev/null</title>
<updated>2007-03-13T06:40:17Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-03-12T18:37:55Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=e4507ae84ed04c835b66f77195a0549b72f99c39'/>
<id>urn:sha1:e4507ae84ed04c835b66f77195a0549b72f99c39</id>
<content type='text'>
Some run-command callers may wish to just discard any data that
is sent to stdout from the child.  This is a lot like our existing
no_stdin support, we just open /dev/null and duplicate the descriptor
into position.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Teach run-command about stdout redirection</title>
<updated>2007-03-13T06:40:17Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-03-12T18:37:45Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f4bba25bdc0ecb4ac338de81a2a65af487701833'/>
<id>urn:sha1:f4bba25bdc0ecb4ac338de81a2a65af487701833</id>
<content type='text'>
Some potential callers of the run_command family of functions need
to control not only the stdin redirection of the child, but also
the stdout redirection of the child.  This can now be setup much
like the already existing stdin redirection.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Simplify closing two fds at once in run-command.c</title>
<updated>2007-03-12T23:31:35Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-03-12T18:37:28Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=9dc09c766463333ca51311a2db86fd67f4fec19b'/>
<id>urn:sha1:9dc09c766463333ca51311a2db86fd67f4fec19b</id>
<content type='text'>
I started hacking on a change to add stdout redirection support to
the run_command family, but found I was using a lot of close calls
on two pipes in an array (such as for pipe).  So I'm doing a tiny
bit of refactoring first to make the next set of changes clearer.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Teach run_command how to setup a stdin pipe</title>
<updated>2007-03-12T05:49:40Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-03-10T08:28:08Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4919bf0354e2a1cfb948c320d45d51319ada30eb'/>
<id>urn:sha1:4919bf0354e2a1cfb948c320d45d51319ada30eb</id>
<content type='text'>
Sometimes callers trying to use run_command to execute a child
process will want to setup a pipe or file descriptor to redirect
into the child's stdin.

This idea is completely stolen from builtin-bundle's fork_with_pipe,
written by Johannes Schindelin.  All credit (and blame) should lie
with Dscho.  ;-)

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Split run_command into two halves (start/finish)</title>
<updated>2007-03-12T05:49:37Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-03-10T08:28:05Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=ebcb5d16ca911d5e21bb8071c185fb47a0c1fbb3'/>
<id>urn:sha1:ebcb5d16ca911d5e21bb8071c185fb47a0c1fbb3</id>
<content type='text'>
If the calling process wants to send data to stdin of a
child process it will need to arrange for a pipe and get
the child process running, feed data to it, then wait
for the child process to finish.  So we split the run
function into two halves, allowing callers to first
start the child then later finish it.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Start defining a more sophisticated run_command</title>
<updated>2007-03-12T05:49:34Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-03-10T08:28:00Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=f1000898d43a30f6a0d3bbde7b4927e97913d010'/>
<id>urn:sha1:f1000898d43a30f6a0d3bbde7b4927e97913d010</id>
<content type='text'>
There are a number of places where we do some variation of
fork()+exec() but we also need to setup redirection in the process,
much like what run_command does for us already with its option flags.

It would be nice to reuse more of the run_command logic, especially
as that non-fork API helps us to port to odd platforms like Win32.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Remove unused run_command variants</title>
<updated>2007-03-12T05:49:31Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-03-10T08:27:52Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=afdb269c76cb965cf8bbb1012c2ec0e2bf7172b1'/>
<id>urn:sha1:afdb269c76cb965cf8bbb1012c2ec0e2bf7172b1</id>
<content type='text'>
We don't actually use these va_list based variants of run_command
anymore.  I'm removing them before I make further improvements.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Use /dev/null for update hook stdin.</title>
<updated>2006-12-31T06:22:14Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2006-12-31T02:55:22Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=95d3c4f546c664c3571dd4a93f11ae2f54e55e6e'/>
<id>urn:sha1:95d3c4f546c664c3571dd4a93f11ae2f54e55e6e</id>
<content type='text'>
Currently the update hook invoked by receive-pack has its stdin
connected to the pushing client.  The hook shouldn't attempt to
read from this stream, and doing so may consume data that was
meant for receive-pack.  Instead we should give the update hook
/dev/null as its stdin, ensuring that it always receives EOF and
doesn't disrupt the protocol if it attempts to read any data.

The post-update hook is similar, as it gets invoked with /dev/null
on stdin to prevent the hook from reading data from the client.
Previously we had invoked it with stdout also connected to /dev/null,
throwing away anything on stdout, to prevent client protocol errors.
Instead we should redirect stdout to stderr, like we do with the
update hook.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Redirect update hook stdout to stderr.</title>
<updated>2006-12-31T06:22:14Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2006-12-31T02:55:19Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=cd83c74cb3161a19b5efd33f40cfe378c2f64ddb'/>
<id>urn:sha1:cd83c74cb3161a19b5efd33f40cfe378c2f64ddb</id>
<content type='text'>
If an update hook outputs to stdout then that output will be sent
back over the wire to the push client as though it were part of
the git protocol.  This tends to cause protocol errors on the
client end of the connection, as the hook output is not expected
in that context.  Most hook developers work around this by making
sure their hook outputs everything to stderr.

But hooks shouldn't need to perform such special behavior.  Instead
we can just dup stderr to stdout prior to invoking the update hook.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Remove unnecessary argc parameter from run_command_v.</title>
<updated>2006-12-31T06:22:14Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2006-12-31T02:55:15Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=9b0b50936ec76ad8e582d18d5bf54bc81c685e9b'/>
<id>urn:sha1:9b0b50936ec76ad8e582d18d5bf54bc81c685e9b</id>
<content type='text'>
The argc parameter is never used by the run_command_v family of
functions.  Instead they require that the passed argv[] be NULL
terminated so they can rely on the operating system's execvp
function to correctly pass the arguments to the new process.

Making the caller pass the argc is just confusing, as the caller
could be mislead into believing that the argc might take precendece
over the argv, or that the argv does not need to be NULL terminated.
So goodbye argc.  Don't come back.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
</feed>
