<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/string-list.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-10-18T04:24:04Z</updated>
<entry>
<title>string-list: mark unused callback parameters</title>
<updated>2022-10-18T04:24:04Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-10-18T01:05:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ee347104576c8a2681edd79ed8328791f0677d2'/>
<id>urn:sha1:1ee347104576c8a2681edd79ed8328791f0677d2</id>
<content type='text'>
String-lists may be used with callbacks for clearing or iteration. These
callbacks need to conform to a particular interface, even though not
every callback needs all of its parameters. Mark the unused ones to make
-Wunused-parameter happy.

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>string-list.[ch]: remove string_list_init() compatibility function</title>
<updated>2021-09-28T21:43:38Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-09-28T12:49:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=abf897bacd2d36b9dbd07c70b4a2f97a084704ee'/>
<id>urn:sha1:abf897bacd2d36b9dbd07c70b4a2f97a084704ee</id>
<content type='text'>
Remove this function left over to accommodate in-flight changes, see
770fedaf9fb (string-list.[ch]: add a string_list_init_{nodup,dup}(),
2021-07-01) for the recent change to add
"string_list_init_{nodup,dup}()" initializers.

There was only one user of the API left in remote-curl.c. I don't know
why I didn't include this change to remote-curl.c in
bc40dfb10a0 (string-list.h users: change to use *_{nodup,dup}(),
2021-07-01), perhaps I just missed it.

In any case, let's change that one user to use the new API, as of
writing this there are no in-flight changes that use, so this seems
like a good time to drop this before we get any new users of this
compatibility API.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>string-list.[ch]: add a string_list_init_{nodup,dup}()</title>
<updated>2021-07-01T19:32:22Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-07-01T10:51:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=770fedaf9fb156bd8c18da41770eac0cb63fba63'/>
<id>urn:sha1:770fedaf9fb156bd8c18da41770eac0cb63fba63</id>
<content type='text'>
In order to use the new "memcpy() a 'blank' struct on the stack"
pattern for string_list_init(), and to make the macro initialization
consistent with the function initialization introduce two new
string_list_init_{nodup,dup}() functions. These are like the old
string_list_init() when called with a false and true second argument,
respectively.

I think this not only makes things more consistent, but also easier to
read. I often had to lookup what the ", 0)" or ", 1)" in these
invocations meant, now it's right there in the function name, and
corresponds to the macros.

A subsequent commit will convert existing API users to this pattern,
but as this is a very common API let's leave a compatibility function
in place for later removal. This intermediate state also proves that
the compatibility function works.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>style: the opening '{' of a function is in a separate line</title>
<updated>2018-12-10T06:41:09Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-12-09T10:25:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b3357626edc841a51d8885ddf6986bab5b6f778'/>
<id>urn:sha1:3b3357626edc841a51d8885ddf6986bab5b6f778</id>
<content type='text'>
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/string-list-remove-unused'</title>
<updated>2018-09-24T17:30:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-24T17:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f8649f8cfc81f9c8b00e32bffc89c3e30cb2a3c0'/>
<id>urn:sha1:f8649f8cfc81f9c8b00e32bffc89c3e30cb2a3c0</id>
<content type='text'>
Code clean-up.

* sb/string-list-remove-unused:
  string-list: remove unused function print_string_list
</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.c: avoid conversion from void * to function pointer</title>
<updated>2018-07-09T21:37:50Z</updated>
<author>
<name>Beat Bolli</name>
<email>dev+git@drbeat.li</email>
</author>
<published>2018-07-09T19:25:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b6d3f5a960c2b5dfe3d8d84e7f4c26e03d721d10'/>
<id>urn:sha1:b6d3f5a960c2b5dfe3d8d84e7f4c26e03d721d10</id>
<content type='text'>
ISO C forbids the conversion of void pointers to function pointers.
Introduce a context struct that encapsulates the function pointer.

Signed-off-by: Beat Bolli &lt;dev+git@drbeat.li&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>cleanup: fix possible overflow errors in binary search</title>
<updated>2017-10-09T23:57:24Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2017-10-08T18:29:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=19716b21a4255ecc7148b54ab2c78039c59f25bf'/>
<id>urn:sha1:19716b21a4255ecc7148b54ab2c78039c59f25bf</id>
<content type='text'>
A common mistake when writing binary search is to allow possible
integer overflow by using the simple average:

	mid = (min + max) / 2;

Instead, use the overflow-safe version:

	mid = min + (max - min) / 2;

This translation is safe since the operation occurs inside a loop
conditioned on "min &lt; max". The included changes were found using
the following git grep:

	git grep '/ *2;' '*.c'

Making this cleanup will prevent future review friction when a new
binary search is contructed based on existing code.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use MOVE_ARRAY</title>
<updated>2017-07-17T21:54:56Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-07-15T20:00:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f331ab9d4cb21942dcde6d879aaca6a1784e8cb6'/>
<id>urn:sha1:f331ab9d4cb21942dcde6d879aaca6a1784e8cb6</id>
<content type='text'>
Simplify the code for moving members inside of an array and make it more
robust by using the helper macro MOVE_ARRAY.  It calculates the size
based on the specified number of elements for us and supports NULL
pointers when that number is zero.  Raw memmove(3) calls with NULL can
cause the compiler to (over-eagerly) optimize out later NULL checks.

This patch was generated with contrib/coccinelle/array.cocci and spatch
(Coccinelle).

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bw/forking-and-threading'</title>
<updated>2017-05-30T02:16:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-05-30T02:16:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7d5e13f652b4dfbf5e399dd2de32e5954368f0f8'/>
<id>urn:sha1:7d5e13f652b4dfbf5e399dd2de32e5954368f0f8</id>
<content type='text'>
The "run-command" API implementation has been made more robust
against dead-locking in a threaded environment.

* bw/forking-and-threading:
  usage.c: drop set_error_handle()
  run-command: restrict PATH search to executable files
  run-command: expose is_executable function
  run-command: block signals between fork and execve
  run-command: add note about forking and threading
  run-command: handle dup2 and close errors in child
  run-command: eliminate calls to error handling functions in child
  run-command: don't die in child when duping /dev/null
  run-command: prepare child environment before forking
  string-list: add string_list_remove function
  run-command: use the async-signal-safe execv instead of execvp
  run-command: prepare command before forking
  t0061: run_command executes scripts without a #! line
  t5550: use write_script to generate post-update hook
</content>
</entry>
</feed>
