<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/string-list.h, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-09-27T00:14:34Z</updated>
<entry>
<title>string-list.h: move documentation from Documentation/api/ into header</title>
<updated>2017-09-27T00:14:34Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2017-09-26T11:21:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4f665f2cf3374db615bd094269e5dd6eb0811006'/>
<id>urn:sha1:4f665f2cf3374db615bd094269e5dd6eb0811006</id>
<content type='text'>
This mirrors commit 'bdfdaa497 ("strbuf.h: integrate api-strbuf.txt
documentation, 2015-01-16") which did the same for strbuf.h:

* API documentation uses /** */ to set it apart from other comments.

* Function names were stripped from the comments.

* Ordering of the header was adjusted to follow the one from the text
  file.

* Edited some existing comments from string-list.h for consistency.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>for_each_string_list_item: avoid undefined behavior for empty list</title>
<updated>2017-09-20T05:41:08Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-09-20T05:27:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ac7da78ede468315ba22d9ee1265b61a744371ee'/>
<id>urn:sha1:ac7da78ede468315ba22d9ee1265b61a744371ee</id>
<content type='text'>
If you pass a newly initialized or newly cleared `string_list` to
`for_each_string_list_item()`, then the latter does

    for (
            item = (list)-&gt;items; /* NULL */
            item &lt; (list)-&gt;items + (list)-&gt;nr; /* NULL + 0 */
            ++item)

Even though this probably works almost everywhere, it is undefined
behavior, and it could plausibly cause highly-optimizing compilers to
misbehave.  C99 section 6.5.6 paragraph 8 explains:

    If both the pointer operand and the result point to elements
    of the same array object, or one past the last element of the
    array object, the evaluation shall not produce an overflow;
    otherwise, the behavior is undefined.

and (6.3.2.3.3) a null pointer does not point to anything.

Guard the loop with a NULL check to make the intent crystal clear to
even the most pedantic compiler.  A suitably clever compiler could let
the NULL check only run in the first iteration, but regardless, this
overhead is likely to be dwarfed by the work to be done on each item.

This problem was noticed by Coverity.

[jn: using a NULL check instead of a placeholder empty list;
 fleshed out the commit message based on mailing list discussion]

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string-list: add string_list_remove function</title>
<updated>2017-04-21T00:55:32Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-04-19T23:13:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a30033327337323e91dcbcb87396d3245260585'/>
<id>urn:sha1:3a30033327337323e91dcbcb87396d3245260585</id>
<content type='text'>
Teach string-list to be able to remove a string from a sorted
'struct string_list'.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/string-list'</title>
<updated>2014-12-22T20:27:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-22T20:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=12b9f08953f4f558789f833b0fe438c25ce6d4b1'/>
<id>urn:sha1:12b9f08953f4f558789f833b0fe438c25ce6d4b1</id>
<content type='text'>
API simplification.

* sb/string-list:
  string_list: remove string_list_insert_at_index() from its API
  mailmap: use higher level string list functions
  string_list: document string_list_(insert,lookup)
</content>
</entry>
<entry>
<title>string_list: remove string_list_insert_at_index() from its API</title>
<updated>2014-12-04T23:10:27Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2014-11-24T21:22:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8c4ab611ac5b714b6b4fd296c59512f97f87195'/>
<id>urn:sha1:f8c4ab611ac5b714b6b4fd296c59512f97f87195</id>
<content type='text'>
There no longer is a caller to this function.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sort_string_list(): rename to string_list_sort()</title>
<updated>2014-11-25T18:11:34Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-11-25T08:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3383e199847485fedf83d0fa38bbd5363074093a'/>
<id>urn:sha1:3383e199847485fedf83d0fa38bbd5363074093a</id>
<content type='text'>
The new name is more consistent with the names of other
string_list-related functions.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string_list: document string_list_(insert,lookup)</title>
<updated>2014-11-25T00:04:12Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2014-11-24T21:22:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc66505c53f1a471e63b6122b2d629daca6e705b'/>
<id>urn:sha1:fc66505c53f1a471e63b6122b2d629daca6e705b</id>
<content type='text'>
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string-list: add string_list initializer helper function</title>
<updated>2014-07-21T17:23:36Z</updated>
<author>
<name>Tanay Abhra</name>
<email>tanayabh@gmail.com</email>
</author>
<published>2014-07-18T09:18:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ed3f5fe85ac3fa7f94ccaab59408a20db8c7a41'/>
<id>urn:sha1:3ed3f5fe85ac3fa7f94ccaab59408a20db8c7a41</id>
<content type='text'>
The string-list API has STRING_LIST_INIT_* macros to be used
to define variables with initializers, but lacks functions
to initialize an uninitialized piece of memory to be used as
a string-list at the run-time.
Introduce `string_list_init()` function for that.

Signed-off-by: Tanay Abhra &lt;tanayabh@gmail.com&gt;
Reviewed-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string-list: spell all values out that are given to a string_list initializer</title>
<updated>2014-06-06T20:49:19Z</updated>
<author>
<name>Tanay Abhra</name>
<email>tanayabh@gmail.com</email>
</author>
<published>2014-06-03T09:13:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=acb3d22264fd3736f95f71aa38e1d6fa01f5e9e1'/>
<id>urn:sha1:acb3d22264fd3736f95f71aa38e1d6fa01f5e9e1</id>
<content type='text'>
STRING_LIST_INIT_{NODUP,DUP} initializers list values only
for earlier structure members, relying on the usual
convention in C that the omitted members are initailized to
0, i.e. the former is expanded to the latter:

	struct string_list l = STRING_LIST_INIT_DUP;
	struct string_list l = { NULL, 0, 0, 1 };

and the last member that is not mentioned (i.e. 'cmp') is
initialized to NULL.

While there is nothing wrong in this construct, spelling out
all the values where the macros are defined will serve also
as a documentation, so let's do so.

Signed-off-by: Tanay Abhra &lt;tanayabh@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ap/log-mailmap'</title>
<updated>2013-01-21T01:06:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-21T01:06:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=577f63e781d2f9b9a6862389b6e9d2ca2467afa2'/>
<id>urn:sha1:577f63e781d2f9b9a6862389b6e9d2ca2467afa2</id>
<content type='text'>
Teach commands in the "log" family to optionally pay attention to
the mailmap.

* ap/log-mailmap:
  log --use-mailmap: optimize for cases without --author/--committer search
  log: add log.mailmap configuration option
  log: grep author/committer using mailmap
  test: add test for --use-mailmap option
  log: add --use-mailmap option
  pretty: use mailmap to display username and email
  mailmap: add mailmap structure to rev_info and pp
  mailmap: simplify map_user() interface
  mailmap: remove email copy and length limitation
  Use split_ident_line to parse author and committer
  string-list: allow case-insensitive string list
</content>
</entry>
</feed>
