<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/argv-array.c, branch v1.7.11</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.11</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.7.11'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2012-04-18T23:16:38Z</updated>
<entry>
<title>argv-array: add a new "pushl" method</title>
<updated>2012-04-18T23:16:38Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-04-18T21:10:05Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=d15bbe1379a12e2d9a5f18f7dc96b38afafc6c5d'/>
<id>urn:sha1:d15bbe1379a12e2d9a5f18f7dc96b38afafc6c5d</id>
<content type='text'>
It can be convenient to push many strings in a single line
(e.g., if you are initializing an array with defaults). This
patch provides a convenience wrapper to allow this.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>argv-array: refactor empty_argv initialization</title>
<updated>2012-04-18T23:16:16Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-04-18T21:08:49Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=fd93d2e60ea66fc3796904ff53ead3ef4755b137'/>
<id>urn:sha1:fd93d2e60ea66fc3796904ff53ead3ef4755b137</id>
<content type='text'>
An empty argv-array is initialized to point to a static
empty NULL-terminated array.  The original implementation
separates the actual storage of the NULL-terminator from the
pointer to the list.  This makes the exposed type a "const
char **", which nicely matches the type stored by the
argv-array.

However, this indirection means that one cannot use
empty_argv to initialize a static variable, since it is
not a constant.

Instead, we can expose empty_argv directly, as an array of
pointers. The only place we use it is in the ARGV_ARRAY_INIT
initializer, and it decays to a pointer appropriately there.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refactor argv_array into generic code</title>
<updated>2011-09-14T18:56:36Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-09-13T21:57:57Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=c1189caeaf726e6c16c8bca7da8bf0b243da478d'/>
<id>urn:sha1:c1189caeaf726e6c16c8bca7da8bf0b243da478d</id>
<content type='text'>
The submodule code recently grew generic code to build a
dynamic argv array. Many other parts of the code can reuse
this, too, so let's make it generically available.

There are two enhancements not found in the original code:

  1. We now handle the NULL-termination invariant properly,
     even when no strings have been pushed (before, you
     could have an empty, NULL argv). This was not a problem
     for the submodule code, which always pushed at least
     one argument, but was not sufficiently safe for
     generic code.

  2. There is a formatted variant of the "push" function.
     This is a convenience function which was not needed by
     the submodule code, but will make it easier to port
     other users to the new code.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
