<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-compat-util.h, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-06-13T20:27:00Z</updated>
<entry>
<title>Merge branch 'bw/forking-and-threading' into maint</title>
<updated>2017-06-13T20:27:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-13T20:26:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e350625b68cf747e4933239735ceb111f4375a83'/>
<id>urn:sha1:e350625b68cf747e4933239735ceb111f4375a83</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>
<entry>
<title>usage.c: drop set_error_handle()</title>
<updated>2017-05-15T04:00:25Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-05-13T03:48:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e3f43ce765c38f4be94239d07c8c3c596780c514'/>
<id>urn:sha1:e3f43ce765c38f4be94239d07c8c3c596780c514</id>
<content type='text'>
The set_error_handle() function was introduced by 3b331e926
(vreportf: report to arbitrary filehandles, 2015-08-11) so
that run-command could send post-fork, pre-exec errors to
the parent's original stderr.

That use went away in 79319b194 (run-command: eliminate
calls to error handling functions in child, 2017-04-19),
which pushes all of the error reporting to the parent.
This leaves no callers of set_error_handle(). As we're not
likely to add any new ones, let's drop it.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Acked-by: Brandon Williams &lt;bmwill@google.com&gt;
Reviewed-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>usage.c: add BUG() function</title>
<updated>2017-05-15T02:29:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-05-13T03:28:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d8193743e0883e7331c102a4d04cee5324eb3b5f'/>
<id>urn:sha1:d8193743e0883e7331c102a4d04cee5324eb3b5f</id>
<content type='text'>
There's a convention in Git's code base to write assertions
as:

  if (...some_bad_thing...)
	die("BUG: the terrible thing happened");

with the idea that users should never see a "BUG:" message
(but if they, it at least gives a clue what happened).  We
use die() here because it's convenient, but there are a few
draw-backs:

  1. Without parsing the messages, it's hard for callers to
     distinguish BUG assertions from regular errors.

     For instance, it would be nice if the test suite could
     check that we don't hit any assertions, but
     test_must_fail will pass BUG deaths as OK.

  2. It would be useful to add more debugging features to
     BUG assertions, like file/line numbers or dumping core.

  3. The die() handler can be replaced, and might not
     actually exit the whole program (e.g., it may just
     pthread_exit()). This is convenient for normal errors,
     but for an assertion failure (which is supposed to
     never happen), we're probably better off taking down
     the whole process as quickly and cleanly as possible.

We could address these by checking in die() whether the
error message starts with "BUG", and behaving appropriately.
But there's little advantage at that point to sharing the
die() code, and only downsides (e.g., we can't change the
BUG() interface independently). Moreover, converting all of
the existing BUG calls reveals that the test suite does
indeed trigger a few of them.

Instead, this patch introduces a new BUG() function, which
prints an error before dying via SIGABRT. This gives us test
suite checking and core dumps.  The function is actually a
macro (when supported) so that we can show the file/line
number.

We can convert die("BUG") invocations to BUG() in further
patches, dealing with any test fallouts individually.

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 'dt/xgethostname-nul-termination'</title>
<updated>2017-04-24T05:07:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-24T05:07:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5938454cbc585e0f4bdd9f1cc87c6886a3c1bff3'/>
<id>urn:sha1:5938454cbc585e0f4bdd9f1cc87c6886a3c1bff3</id>
<content type='text'>
gethostname(2) may not NUL terminate the buffer if hostname does
not fit; unfortunately there is no easy way to see if our buffer
was too small, but at least this will make sure we will not end up
using garbage past the end of the buffer.

* dt/xgethostname-nul-termination:
  xgethostname: handle long hostnames
  use HOST_NAME_MAX to size buffers for gethostname(2)
</content>
</entry>
<entry>
<title>xgethostname: handle long hostnames</title>
<updated>2017-04-19T02:58:04Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twosigma.com</email>
</author>
<published>2017-04-18T21:57:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5781a9a2703e96b01587bb95ceebcc53f2cee91c'/>
<id>urn:sha1:5781a9a2703e96b01587bb95ceebcc53f2cee91c</id>
<content type='text'>
If the full hostname doesn't fit in the buffer supplied to
gethostname, POSIX does not specify whether the buffer will be
null-terminated, so to be safe, we should do it ourselves.  Introduce
new function, xgethostname, which ensures that there is always a \0
at the end of the buffer.

Signed-off-by: David Turner &lt;dturner@twosigma.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use HOST_NAME_MAX to size buffers for gethostname(2)</title>
<updated>2017-04-19T02:57:41Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-04-18T21:57:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=da25bdb7766c01665500cf7c7b75e76ea1f28b49'/>
<id>urn:sha1:da25bdb7766c01665500cf7c7b75e76ea1f28b49</id>
<content type='text'>
POSIX limits the length of host names to HOST_NAME_MAX.  Export the
fallback definition from daemon.c and use this constant to make all
buffers used with gethostname(2) big enough for any possible result
and a terminating NUL.

Inspired-by: David Turner &lt;dturner@twosigma.com&gt;
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: David Turner &lt;dturner@twosigma.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/pack-name-cleanups'</title>
<updated>2017-03-21T22:07:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-03-21T22:07:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=45cbc37c5f84fadd78cccf6b2ea82a9ef251cdc6'/>
<id>urn:sha1:45cbc37c5f84fadd78cccf6b2ea82a9ef251cdc6</id>
<content type='text'>
Code clean-up.

* jk/pack-name-cleanups:
  index-pack: make pointer-alias fallbacks safer
  replace snprintf with odb_pack_name()
  odb_pack_keep(): stop generating keepfile name
  sha1_file.c: make pack-name helper globally accessible
  move odb_* declarations out of git-compat-util.h
</content>
</entry>
<entry>
<title>move odb_* declarations out of git-compat-util.h</title>
<updated>2017-03-16T18:04:34Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-03-16T14:27:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=82c9d6614bcd80bc2b6646f3943971fa0ec20135'/>
<id>urn:sha1:82c9d6614bcd80bc2b6646f3943971fa0ec20135</id>
<content type='text'>
These functions were originally conceived as wrapper
functions similar to xmkstemp(). They were later moved by
463db9b10 (wrapper: move odb_* to environment.c,
2010-11-06). The more appropriate place for a declaration is
in cache.h.

While we're at it, let's add some basic docstrings.

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>wrapper.c: remove unused gitmkstemps() function</title>
<updated>2017-02-28T19:54:21Z</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsayjones.plus.com</email>
</author>
<published>2017-02-28T01:26:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2d593a7797f4f9452e46f722e181604a5582897'/>
<id>urn:sha1:b2d593a7797f4f9452e46f722e181604a5582897</id>
<content type='text'>
The last call to the mkstemps() function was removed in commit 659488326
("wrapper.c: delete dead function git_mkstemps()", 22-04-2016). In order
to support platforms without mkstemps(), this functionality was provided,
along with a Makefile build variable (NO_MKSTEMPS), by the gitmkstemps()
function. Remove the dead code, along with the defunct build machinery.

Signed-off-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/swap'</title>
<updated>2017-02-15T20:54:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-02-15T20:54:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cbf1860d73b782e7924e63361df485b31225a26a'/>
<id>urn:sha1:cbf1860d73b782e7924e63361df485b31225a26a</id>
<content type='text'>
Code clean-up.

* rs/swap:
  graph: use SWAP macro
  diff: use SWAP macro
  use SWAP macro
  apply: use SWAP macro
  add SWAP macro
</content>
</entry>
</feed>
