<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/wrapper.c, 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-04-24T05:07:57Z</updated>
<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>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>wrapper.c: remove unused git_mkstemp() function</title>
<updated>2017-02-28T19:54:14Z</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsayjones.plus.com</email>
</author>
<published>2017-02-28T01:24:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=34de5e4bb0dfe1c05b57c733c2196f1ad3881a98'/>
<id>urn:sha1:34de5e4bb0dfe1c05b57c733c2196f1ad3881a98</id>
<content type='text'>
The last caller of git_mkstemp() was removed in commit 6fec0a89
("verify_signed_buffer: use tempfile object", 16-06-2016). Since
the introduction of the 'tempfile' APIs, along with git_mkstemp_mode,
it is unlikely that new callers will materialize. Remove the dead
code.

Signed-off-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.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>Merge branch 'jk/write-file'</title>
<updated>2016-07-19T20:22:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-19T20:22:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b6456b8089e42232d80672525edbe411ba41549'/>
<id>urn:sha1:2b6456b8089e42232d80672525edbe411ba41549</id>
<content type='text'>
General code clean-up around a helper function to write a
single-liner to a file.

* jk/write-file:
  branch: use write_file_buf instead of write_file
  use write_file_buf where applicable
  write_file: add format attribute
  write_file: add pointer+len variant
  write_file: use xopen
  write_file: drop "gently" form
  branch: use non-gentle write_file for branch description
  am: ignore return value of write_file()
  config: fix bogus fd check when setting up default config
</content>
</entry>
<entry>
<title>Merge branch 'sb/submodule-parallel-fetch'</title>
<updated>2016-07-19T20:22:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-19T20:22:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7725bebe21dfa4877dad74b1ac3d921f26f949cf'/>
<id>urn:sha1:7725bebe21dfa4877dad74b1ac3d921f26f949cf</id>
<content type='text'>
Fix recently introduced codepaths that are involved in parallel
submodule operations, which gave up on reading too early, and
could have wasted CPU while attempting to write under a corner
case condition.

* sb/submodule-parallel-fetch:
  hoist out handle_nonblock function for xread and xwrite
  xwrite: poll on non-blocking FDs
  xread: retry after poll on EAGAIN/EWOULDBLOCK
</content>
</entry>
<entry>
<title>hoist out handle_nonblock function for xread and xwrite</title>
<updated>2016-07-11T16:51:45Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2016-07-10T08:20:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d751dd11ae16fd4e2410d3a32c8e2d951fafc923'/>
<id>urn:sha1:d751dd11ae16fd4e2410d3a32c8e2d951fafc923</id>
<content type='text'>
At least for me, this improves the readability of xread and
xwrite; hopefully allowing missing "continue" statements to
be spotted more easily.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
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>write_file: add pointer+len variant</title>
<updated>2016-07-08T16:47:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-07-08T09:12:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=52563d7ecc8f3f38cb1c0521294c5f6a0a475637'/>
<id>urn:sha1:52563d7ecc8f3f38cb1c0521294c5f6a0a475637</id>
<content type='text'>
There are many callsites which could use write_file, but for
which it is a little awkward because they have a strbuf or
other pointer/len combo. Specifically:

 1. write_file() takes a format string, so we have to use
    "%s" or "%.*s", which are ugly.

 2. Using any form of "%s" does not handle embedded NULs in
    the output. That probably doesn't matter for our
    call-sites, but it's nicer not to have to worry.

 3. It's less efficient; we format into another strbuf
    just to do the write. That's probably not measurably
    slow for our uses, but it's simply inelegant.

We can fix this by providing a helper to write out the
formatted buffer, and just calling it from write_file().

Note that we don't do the usual "complete with a newline"
that write_file does. If the caller has their own buffer,
there's a reasonable chance they're doing something more
complicated than a single line, and they can call
strbuf_complete_line() themselves.

We could go even further and add strbuf_write_file(), but it
doesn't save much:

  -  write_file_buf(path, sb.buf, sb.len);
  +  strbuf_write_file(&amp;sb, path);

It would also be somewhat asymmetric with strbuf_read_file,
which actually returns errors rather than dying (and the
error handling is most of the benefit of write_file() in the
first place).

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>write_file: use xopen</title>
<updated>2016-07-08T16:47:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-07-08T09:10:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee861e0f78367ff0e94feeb42f721ef83ceec251'/>
<id>urn:sha1:ee861e0f78367ff0e94feeb42f721ef83ceec251</id>
<content type='text'>
This simplifies the code a tiny bit, and provides consistent
error messages with other users of xopen().

While we're here, let's also switch to using O_WRONLY. We
know we're only going to open/write/close the file, so
there's no point in asking for O_RDWR.

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>write_file: drop "gently" form</title>
<updated>2016-07-08T16:47:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-07-08T09:09:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef22318cff51244cd0047b11ee7accfded522782'/>
<id>urn:sha1:ef22318cff51244cd0047b11ee7accfded522782</id>
<content type='text'>
There are no callers left of write_file_gently(). Let's drop
it, as it doesn't seem likely for new callers to be added
(since its inception, the only callers who wanted the gentle
form generally just died immediately themselves, and have
since been converted).

While we're there, let's also drop the "int" return from
write_file, as it is never meaningful (in the non-gentle
form, we always either die or return 0).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
