<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/string-list.h, branch v2.22.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.22.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.22.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-05-05T06:20:10Z</updated>
<entry>
<title>*.[ch]: manually align parameter lists</title>
<updated>2019-05-05T06:20:10Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2019-04-29T08:28:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ad6dad0996f9226b2c3a5a3c725bf2952e52d7e7'/>
<id>urn:sha1:ad6dad0996f9226b2c3a5a3c725bf2952e52d7e7</id>
<content type='text'>
In previous patches, extern was mechanically removed from function
declarations without care to formatting, causing parameter lists to be
misaligned. Manually format changed sections such that the parameter
lists should be realigned.

Viewing this patch with 'git diff -w' should produce no output.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>*.[ch]: remove extern from function declarations using spatch</title>
<updated>2019-05-05T06:20:06Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2019-04-29T08:28:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=554544276a604c144df45efcb060c80aa322088c'/>
<id>urn:sha1:554544276a604c144df45efcb060c80aa322088c</id>
<content type='text'>
There has been a push to remove extern from function declarations.
Remove some instances of "extern" for function declarations which are
caught by Coccinelle. Note that Coccinelle has some difficulty with
processing functions with `__attribute__` or varargs so some `extern`
declarations are left behind to be dealt with in a future patch.

This was the Coccinelle patch used:

	@@
	type T;
	identifier f;
	@@
	- extern
	  T f(...);

and it was run with:

	$ git ls-files \*.{c,h} |
		grep -v ^compat/ |
		xargs spatch --sp-file contrib/coccinelle/noextern.cocci --in-place

Files under `compat/` are intentionally excluded as some are directly
copied from external sources and we should avoid churning them as much
as possible.

Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string-list: remove unused function print_string_list</title>
<updated>2018-09-11T19:27:58Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-09-11T18:48:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0597dd62ba428dd02b2bf280ede4cdb0b2e318c0'/>
<id>urn:sha1:0597dd62ba428dd02b2bf280ede4cdb0b2e318c0</id>
<content type='text'>
A removal of this helper function was proposed 3 years ago [1]; the
function was never used since it was introduced in 2006 back then,
and there is no new callers since.  Now time has proven we really do
not need the function.

[1] https://public-inbox.org/git/1421343725-3973-1-git-send-email-kuleshovmail@gmail.com/

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.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>
</feed>
