<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/setup.c, branch v2.12.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.12.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.12.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-03-08T22:38:41Z</updated>
<entry>
<title>real_pathdup(): fix callsites that wanted it to die on error</title>
<updated>2017-03-08T22:38:41Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-03-08T15:43:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce83eadd9a2c63db6263df91933da1b1b865d26a'/>
<id>urn:sha1:ce83eadd9a2c63db6263df91933da1b1b865d26a</id>
<content type='text'>
In 4ac9006f832 (real_path: have callers use real_pathdup and
strbuf_realpath, 2016-12-12), we changed the xstrdup(real_path())
pattern to use real_pathdup() directly.

The problem with this change is that real_path() calls
strbuf_realpath() with die_on_error = 1 while real_pathdup() calls
it with die_on_error = 0. Meaning that in cases where real_path()
causes Git to die() with an error message, real_pathdup() is silent
and returns NULL instead.

The callers, however, are ill-prepared for that change, as they expect
the return value to be non-NULL (and otherwise the function died
with an appropriate error message).

Fix this by extending real_pathdup()'s signature to accept the
die_on_error flag and simply pass it through to strbuf_realpath(),
and then adjust all callers after a careful audit whether they would
handle NULLs well.

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>cache.h: expose the dying procedure for reading gitlinks</title>
<updated>2017-01-26T19:00:58Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-01-24T23:56:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5f29433f1ca1efc35d546a056200d923e86e3fca'/>
<id>urn:sha1:5f29433f1ca1efc35d546a056200d923e86e3fca</id>
<content type='text'>
In a later patch we want to react to only a subset of errors, defaulting
the rest to die as usual. Separate the block that takes care of dying
into its own function so we have easy access to it.

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>setup: add gentle version of resolve_git_dir</title>
<updated>2017-01-26T19:00:24Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-01-24T23:56:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=40d96325143ae04cb3f645ac96f6413d1f641b9b'/>
<id>urn:sha1:40d96325143ae04cb3f645ac96f6413d1f641b9b</id>
<content type='text'>
This follows a93bedada (setup: add gentle version of read_gitfile,
2015-06-09), and assumes the same reasoning. resolve_git_dir is unsuited
for speculative calls, so we want to use the gentle version to find out
about potential errors.

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>real_path: have callers use real_pathdup and strbuf_realpath</title>
<updated>2016-12-12T23:22:32Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2016-12-12T18:16:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4ac9006f832d98ca1f25d956e12f3ff79e0d25bc'/>
<id>urn:sha1:4ac9006f832d98ca1f25d956e12f3ff79e0d25bc</id>
<content type='text'>
Migrate callers of real_path() who duplicate the retern value to use
real_pathdup or strbuf_realpath.

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>i18n: setup: mark error messages for translation</title>
<updated>2016-08-09T19:44:59Z</updated>
<author>
<name>Vasco Almeida</name>
<email>vascomalmeida@sapo.pt</email>
</author>
<published>2016-08-08T11:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2ff30e67d996b89fe16517a2ba4b55b417172389'/>
<id>urn:sha1:2ff30e67d996b89fe16517a2ba4b55b417172389</id>
<content type='text'>
Signed-off-by: Vasco Almeida &lt;vascomalmeida@sapo.pt&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>i18n: setup: mark strings for translation</title>
<updated>2016-06-17T22:45:48Z</updated>
<author>
<name>Vasco Almeida</name>
<email>vascomalmeida@sapo.pt</email>
</author>
<published>2016-06-17T20:21:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ab33a76ec5313b00d630a14d2a843cdb942ed2be'/>
<id>urn:sha1:ab33a76ec5313b00d630a14d2a843cdb942ed2be</id>
<content type='text'>
Update tests that compare the strings newly marked for translation to
succeed when running under GETTEXT_POISON.

Signed-off-by: Vasco Almeida &lt;vascomalmeida@sapo.pt&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/xstrfmt-null-with-prec-0'</title>
<updated>2016-04-22T22:45:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-04-22T22:45:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3f80d16c1c0db9834806e3c430197a8d3442094c'/>
<id>urn:sha1:3f80d16c1c0db9834806e3c430197a8d3442094c</id>
<content type='text'>
* jc/xstrfmt-null-with-prec-0:
  setup.c: do not feed NULL to "%.*s" even with precision 0
</content>
</entry>
<entry>
<title>Merge branch 'jk/check-repository-format'</title>
<updated>2016-04-13T21:12:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-04-13T21:12:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=907c416534dbf110a4659b64ae65806f2b1e8d4d'/>
<id>urn:sha1:907c416534dbf110a4659b64ae65806f2b1e8d4d</id>
<content type='text'>
The repository set-up sequence has been streamlined (the biggest
change is that there is no longer git_config_early()), so that we
do not attempt to look into refs/* when we know we do not have a
Git repository.

* jk/check-repository-format:
  verify_repository_format: mark messages for translation
  setup: drop repository_format_version global
  setup: unify repository version callbacks
  init: use setup.c's repo version verification
  setup: refactor repo format reading and verification
  config: drop git_config_early
  check_repository_format_gently: stop using git_config_early
  lazily load core.sharedrepository
  wrap shared_repository global in get/set accessors
  setup: document check_repository_format()
</content>
</entry>
<entry>
<title>setup.c: do not feed NULL to "%.*s" even with precision 0</title>
<updated>2016-04-07T19:40:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-04-07T19:38:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=24041d6be54d89b5fb0b2bbf70df04bbbff6ba9e'/>
<id>urn:sha1:24041d6be54d89b5fb0b2bbf70df04bbbff6ba9e</id>
<content type='text'>
A recent update 75faa45a (replace trivial malloc + sprintf / strcpy
calls with xstrfmt, 2015-09-24) rewrote

	prepare an empty buffer
	if (len)
        	append the first len bytes of "prefix" to the buffer
	append "path" to the buffer

that computed "path", optionally prefixed by "prefix", into

	xstrfmt("%.*s%s", len, prefix, path);

However, passing a NULL pointer to the printf(3) family of functions
to format it with %s conversion, even with the precision set to 0,
i.e.

	xstrfmt("%.*s", 0, NULL)

yields undefined results, at least on some platforms.

Avoid this problem by substituting prefix with "" when len==0, as
prefix can legally be NULL in that case.  This would mimick the
intent of the original code better.

Reported-by: Tom G. Christensen &lt;tgc@jupiterrise.com&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>verify_repository_format: mark messages for translation</title>
<updated>2016-03-11T23:02:24Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-03-11T22:37:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=274db840b48d144a8f0f8d8bd324365670c67275'/>
<id>urn:sha1:274db840b48d144a8f0f8d8bd324365670c67275</id>
<content type='text'>
These messages are human-readable and should be translated.

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