<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/argv-array.c, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-06-15T19:40:49Z</updated>
<entry>
<title>argv-array: implement argv_array_pushv()</title>
<updated>2015-06-15T19:40:49Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-06-14T08:41:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=85b343245b495a47f937007e1c0650f2070b9b4f'/>
<id>urn:sha1:85b343245b495a47f937007e1c0650f2070b9b4f</id>
<content type='text'>
When we have a null-terminated array, it would be useful to convert it
or append it to an argv_array for further manipulation.

Implement argv_array_pushv() which will push a null-terminated array of
strings on to an argv_array.

Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>argv-array: drop "detach" code</title>
<updated>2014-05-15T16:49:12Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-05-15T08:41:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ff857e4ee8680af3988aff3383b1158f396a6fb2'/>
<id>urn:sha1:ff857e4ee8680af3988aff3383b1158f396a6fb2</id>
<content type='text'>
The argv_array_detach function (and associated free() function) was
really only useful for transferring ownership of the memory to a "struct
child_process". Now that we have an internal argv_array in that struct,
there are no callers left.

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>Merge branch 'fa/remote-svn'</title>
<updated>2012-10-25T10:42:02Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-10-25T10:42:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=530f237500ba00c03fee23c2db599870ff62c196'/>
<id>urn:sha1:530f237500ba00c03fee23c2db599870ff62c196</id>
<content type='text'>
A GSoC project.

* fa/remote-svn:
  Add a test script for remote-svn
  remote-svn: add marks-file regeneration
  Add a svnrdump-simulator replaying a dump file for testing
  remote-svn: add incremental import
  remote-svn: Activate import/export-marks for fast-import
  Create a note for every imported commit containing svn metadata
  vcs-svn: add fast_export_note to create notes
  Allow reading svn dumps from files via file:// urls
  remote-svn, vcs-svn: Enable fetching to private refs
  When debug==1, start fast-import with "--stats" instead of "--quiet"
  Add documentation for the 'bidi-import' capability of remote-helpers
  Connect fast-import to the remote-helper via pipe, adding 'bidi-import' capability
  Add argv_array_detach and argv_array_free_detached
  Add svndump_init_fd to allow reading dumps from arbitrary FDs
  Add git-remote-testsvn to Makefile
  Implement a remote helper for svn in C
</content>
</entry>
<entry>
<title>Add argv_array_detach and argv_array_free_detached</title>
<updated>2012-10-07T21:10:16Z</updated>
<author>
<name>Florian Achleitner</name>
<email>florian.achleitner.2.6.31@gmail.com</email>
</author>
<published>2012-09-19T15:21:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df7428eca46ec25df5ef14bc7e90120bdc267328'/>
<id>urn:sha1:df7428eca46ec25df5ef14bc7e90120bdc267328</id>
<content type='text'>
Allow detaching of ownership of the argv_array's contents and add a
function to free those detached argv_arrays later.

This makes it possible to use argv_array efficiently with the exiting
struct child_process which only contains a member char **argv.

Add to documentation.

Signed-off-by: Florian Achleitner &lt;florian.achleitner.2.6.31@gmail.com&gt;
Acked-by: David Michael Barr &lt;b@rr-dav.id.au&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>argv-array: fix bogus cast when freeing array</title>
<updated>2012-09-03T04:10:24Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-09-01T11:34:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ba4d1c7b1623b2c7ec198aee08036acf779375e6'/>
<id>urn:sha1:ba4d1c7b1623b2c7ec198aee08036acf779375e6</id>
<content type='text'>
Since the array struct stores a "const char **" argv member
(for compatibility with most of our argv-taking functions),
we have to cast away the const-ness when freeing its
elements.

However, we used the wrong type when doing so.  It doesn't
make a difference since free() take a void pointer anyway,
but it can be slightly confusing to a reader.

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: add pop function</title>
<updated>2012-09-03T04:10:01Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-09-01T11:25:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe4a0a288842e225f99254b3e6ce14ff98875501'/>
<id>urn:sha1:fe4a0a288842e225f99254b3e6ce14ff98875501</id>
<content type='text'>
Sometimes we build a set of similar command lines, differing
only in the final arguments (e.g., "fetch --multiple"). To
use argv_array for this, you have to either push the same
set of elements repeatedly, or break the abstraction by
manually manipulating the array's internal members.

Instead, let's provide a sanctioned "pop" function to remove
elements from the end.

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: 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://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://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://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>
