<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-compat-util.h, branch v2.6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-11-05T20:18:13Z</updated>
<entry>
<title>Merge branch 'js/misc-fixes' into maint</title>
<updated>2015-11-05T20:18:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-11-05T20:18:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ace5348dcb427bbce015a42a21a46dc02ae1b37b'/>
<id>urn:sha1:ace5348dcb427bbce015a42a21a46dc02ae1b37b</id>
<content type='text'>
Various compilation fixes and squelching of warnings.

* js/misc-fixes:
  Correct fscanf formatting string for I64u values
  Silence GCC's "cast of pointer to integer of a different size" warning
  Squelch warning about an integer overflow
</content>
</entry>
<entry>
<title>Correct fscanf formatting string for I64u values</title>
<updated>2015-10-26T20:24:03Z</updated>
<author>
<name>Waldek Maleska</name>
<email>w.maleska@gmail.com</email>
</author>
<published>2015-10-26T13:15:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fdcdb778551b904d57c127d9a3546f6a7c8792d3'/>
<id>urn:sha1:fdcdb778551b904d57c127d9a3546f6a7c8792d3</id>
<content type='text'>
This fix is probably purely cosmetic because PRIuMAX is likely identical
to SCNuMAX. Nevertheless, when using a function of the scanf() family,
the correct interpolation to use is the latter, not the former.

Signed-off-by: Waldek Maleska &lt;w.maleska@gmail.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Squelch warning about an integer overflow</title>
<updated>2015-10-26T20:23:59Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2015-10-26T13:15:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8f7744235844c44e780e026868beef29693c062e'/>
<id>urn:sha1:8f7744235844c44e780e026868beef29693c062e</id>
<content type='text'>
We cannot rely on long integers to have more than 32 bits.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/long-error-messages'</title>
<updated>2015-08-25T21:57:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-25T21:57:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1302c9f514686e32065130ec9a80eb0db224e819'/>
<id>urn:sha1:1302c9f514686e32065130ec9a80eb0db224e819</id>
<content type='text'>
The codepath to produce error messages had a hard-coded limit to
the size of the message, primarily to avoid memory allocation while
calling die().

* jk/long-error-messages:
  vreportf: avoid intermediate buffer
  vreportf: report to arbitrary filehandles
</content>
</entry>
<entry>
<title>vreportf: report to arbitrary filehandles</title>
<updated>2015-08-11T21:24:50Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-08-11T18:06:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b331e92671469614662830402103848a8004b97'/>
<id>urn:sha1:3b331e92671469614662830402103848a8004b97</id>
<content type='text'>
The vreportf function always goes to stderr, but run-command
wants child errors to go to the parent's original stderr. To
solve this, commit a5487dd duplicates the stderr fd and
installs die and error handlers to direct the output
appropriately (which later turned into the vwritef
function). This has two downsides, though:

  - we make multiple calls to write(), which contradicts the
    "write at once" logic from d048a96 (print
    warning/error/fatal messages in one shot, 2007-11-09).

  - the custom handlers basically duplicate the normal
    handlers.  They're only a few lines of code, but we
    should not have to repeat the magic "exit(128)", for
    example.

We can solve the first by using fdopen() on the duplicated
descriptor. We can't pass this to vreportf, but we could
introduce a new vreportf_to to handle it.

However, to fix the second problem, we instead introduce a
new "set_error_handle" function, which lets the normal
vreportf calls output to a handle besides stderr. Thus we
can get rid of our custom handlers entirely, and just ask
the regular handlers to output to our new descriptor.

And as vwritef has no more callers, it can just go away.

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: implement xfopen()</title>
<updated>2015-08-05T05:02:11Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-08-04T13:51:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=260eec292736388831958637eccdcf1a8f00e14d'/>
<id>urn:sha1:260eec292736388831958637eccdcf1a8f00e14d</id>
<content type='text'>
A common usage pattern of fopen() is to check if it succeeded, and die()
if it failed:

	FILE *fp = fopen(path, "w");
	if (!fp)
		die_errno(_("could not open '%s' for writing"), path);

Implement a wrapper function xfopen() for the above, so that we can save
a few lines of code and make the die() messages consistent.

Helped-by: Jeff King &lt;peff@peff.net&gt;
Helped-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>wrapper: implement xopen()</title>
<updated>2015-08-05T05:02:11Z</updated>
<author>
<name>Paul Tan</name>
<email>pyokagan@gmail.com</email>
</author>
<published>2015-08-04T13:51:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ff53df7b4cbc331d302181d2d6644f4cb860a52'/>
<id>urn:sha1:3ff53df7b4cbc331d302181d2d6644f4cb860a52</id>
<content type='text'>
A common usage pattern of open() is to check if it was successful, and
die() if it was not:

	int fd = open(path, O_WRONLY | O_CREAT, 0777);
	if (fd &lt; 0)
		die_errno(_("Could not open '%s' for writing."), path);

Implement a wrapper function xopen() that does the above so that we can
save a few lines of code, and make the die() messages consistent.

Helped-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Helped-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Paul Tan &lt;pyokagan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cb/array-size'</title>
<updated>2015-06-25T18:07:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-25T18:07:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5416f8af0f632d05371868bc4340327e1672c83c'/>
<id>urn:sha1:5416f8af0f632d05371868bc4340327e1672c83c</id>
<content type='text'>
* cb/array-size:
  Fix definition of ARRAY_SIZE for non-gcc builds
</content>
</entry>
<entry>
<title>Fix definition of ARRAY_SIZE for non-gcc builds</title>
<updated>2015-06-25T00:14:00Z</updated>
<author>
<name>Charles Bailey</name>
<email>cbailey32@bloomberg.net</email>
</author>
<published>2015-06-24T22:12:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e2c6f7cd5a66ed0009662d2651e0cf3c655e83a9'/>
<id>urn:sha1:e2c6f7cd5a66ed0009662d2651e0cf3c655e83a9</id>
<content type='text'>
The improved ARRAY_SIZE macro uses BARF_UNLESS_AN_ARRAY which expands
to a valid check for recent gcc versions and to 0 for older gcc
versions but is not defined on non-gcc builds.

Non-gcc builds need this macro to expand to 0 as well. The current outer
test (defined(__GNUC__) &amp;&amp; (__GNUC__ &gt;= 3)) is a strictly weaker
condition than the inner test (GIT_GNUC_PREREQ(3, 1)) so we can omit the
outer test and cause the BARF_UNLESS_AN_ARRAY macro to be defined
correctly on non-gcc builds as well as gcc builds with older versions.

Signed-off-by: Charles Bailey &lt;cbailey32@bloomberg.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/diagnose-config-mmap-failure'</title>
<updated>2015-06-11T16:29:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-11T16:29:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dee47925c1d001947cf9a099e1cb883835f90c64'/>
<id>urn:sha1:dee47925c1d001947cf9a099e1cb883835f90c64</id>
<content type='text'>
The configuration reader/writer uses mmap(2) interface to access
the files; when we find a directory, it barfed with "Out of memory?".

* jk/diagnose-config-mmap-failure:
  xmmap(): drop "Out of memory?"
  config.c: rewrite ENODEV into EISDIR when mmap fails
  config.c: avoid xmmap error messages
  config.c: fix mmap leak when writing config
  read-cache.c: drop PROT_WRITE from mmap of index
</content>
</entry>
</feed>
