<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/strbuf.c, branch v2.15.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.15.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.15.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-08-22T17:29:15Z</updated>
<entry>
<title>Merge branch 'rs/strbuf-getwholeline-fix'</title>
<updated>2017-08-22T17:29:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-22T17:29:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0c493966ff6af8d2217aaa40dd6f7916bd992b0a'/>
<id>urn:sha1:0c493966ff6af8d2217aaa40dd6f7916bd992b0a</id>
<content type='text'>
A helper function to read a single whole line into strbuf
mistakenly triggered OOM error at EOF under certain conditions,
which has been fixed.

* rs/strbuf-getwholeline-fix:
  strbuf: clear errno before calling getdelim(3)
</content>
</entry>
<entry>
<title>strbuf: clear errno before calling getdelim(3)</title>
<updated>2017-08-10T21:41:51Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-08-10T20:56:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=642956cf455ff8635be32b3160b12369da73cfe2'/>
<id>urn:sha1:642956cf455ff8635be32b3160b12369da73cfe2</id>
<content type='text'>
getdelim(3) returns -1 at the end of the file and if it encounters an
error, but sets errno only in the latter case.  Set errno to zero before
calling it to avoid misdiagnosing an out-of-memory condition due to a
left-over value from some other function call.

Reported-by: Yaroslav Halchenko &lt;yoh@onerussian.com&gt;
Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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 'ab/strbuf-addftime-tzname-boolify'</title>
<updated>2017-07-07T01:14:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-07-07T01:14:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6ba649e4085bd7b8c80fd2080ca003bf450c9f53'/>
<id>urn:sha1:6ba649e4085bd7b8c80fd2080ca003bf450c9f53</id>
<content type='text'>
strbuf_addftime() is further getting tweaked.

* ab/strbuf-addftime-tzname-boolify:
  strbuf: change an always NULL/"" strbuf_addftime() param to bool
  strbuf.h comment: discuss strbuf_addftime() arguments in order
</content>
</entry>
<entry>
<title>strbuf: change an always NULL/"" strbuf_addftime() param to bool</title>
<updated>2017-07-01T17:47:05Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2017-07-01T13:15:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3b702239d6399685aa69539b83be5f744cfa10e3'/>
<id>urn:sha1:3b702239d6399685aa69539b83be5f744cfa10e3</id>
<content type='text'>
strbuf_addftime() allows callers to pass a time zone name for
expanding %Z. The only current caller either passes the empty string
or NULL, in which case %Z is handed over verbatim to strftime(3).
Replace that string parameter with a flag controlling whether to
remove %Z from the format specification. This simplifies the code.

Commit-message-by: René Scharfe &lt;l.s.r@web.de&gt;
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>Merge branch 'rs/pretty-add-again'</title>
<updated>2017-06-24T21:28:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-24T21:28:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8af3c643d9c042d806a17fe706470a8c1acee231'/>
<id>urn:sha1:8af3c643d9c042d806a17fe706470a8c1acee231</id>
<content type='text'>
The pretty-format specifiers like '%h', '%t', etc. had an
optimization that no longer works correctly.  In preparation/hope
of getting it correctly implemented, first discard the optimization
that is broken.

* rs/pretty-add-again:
  pretty: recalculate duplicate short hashes
</content>
</entry>
<entry>
<title>strbuf: let strbuf_addftime handle %z and %Z itself</title>
<updated>2017-06-15T21:34:37Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-06-15T12:29:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c3fbf81a8534cf88ff948d12004eb94929ec1174'/>
<id>urn:sha1:c3fbf81a8534cf88ff948d12004eb94929ec1174</id>
<content type='text'>
There is no portable way to pass timezone information to strftime.  Add
parameters for timezone offset and name to strbuf_addftime and let it
handle the timezone-related format specifiers %z and %Z internally.

Callers can opt out for %Z by passing NULL as timezone name.  %z is
always handled internally -- this helps on Windows, where strftime would
expand it to a timezone name (same as %Z), in violation of POSIX.
Modifiers are not handled, e.g. %Ez is still passed to strftime.

Use an empty string as timezone name in show_date (the only current
caller) for now because we only have the timezone offset in non-local
mode.  POSIX allows %Z to resolve to an empty string in case of missing
information.

Helped-by: Ulrich Mueller &lt;ulm@gentoo.org&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
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>pretty: recalculate duplicate short hashes</title>
<updated>2017-06-15T18:40:53Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-06-14T18:24:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe9e2aefd4adac63821d0c007effcc8087e32ad6'/>
<id>urn:sha1:fe9e2aefd4adac63821d0c007effcc8087e32ad6</id>
<content type='text'>
b9c6232138 (--format=pretty: avoid calculating expensive expansions
twice) optimized adding short hashes multiple times by using the
fact that the output strbuf was only ever simply appended to and
copying the added string from the previous run.  That prerequisite
is no longer given; we now have modfiers like %&lt; and %+ that can
cause the cache to lose track of the correct offsets.  Remove it.

Reported-by: Michael Giuffrida &lt;michaelpg@chromium.org&gt;
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 'rs/freebsd-getcwd-workaround'</title>
<updated>2017-03-30T21:07:15Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-03-30T21:07:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=49a8fe8e962ed929cf5bed5520e581025f5bfe9a'/>
<id>urn:sha1:49a8fe8e962ed929cf5bed5520e581025f5bfe9a</id>
<content type='text'>
FreeBSD implementation of getcwd(3) behaved differently when an
intermediate directory is unreadable/unsearchable depending on the
length of the buffer provided, which our strbuf_getcwd() was not
aware of.  strbuf_getcwd() has been taught to cope with it better.

* rs/freebsd-getcwd-workaround:
  strbuf: support long paths w/o read rights in strbuf_getcwd() on FreeBSD
</content>
</entry>
<entry>
<title>strbuf: support long paths w/o read rights in strbuf_getcwd() on FreeBSD</title>
<updated>2017-03-27T00:41:05Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-03-26T13:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a54e938e5b53c76ebcd5c068a4f74739c1c68bac'/>
<id>urn:sha1:a54e938e5b53c76ebcd5c068a4f74739c1c68bac</id>
<content type='text'>
FreeBSD implements getcwd(3) as a syscall, but falls back to a version
based on readdir(3) if it fails for some reason.  The latter requires
permissions to read and execute path components, while the former does
not.  That means that if our buffer is too small and we're missing
rights we could get EACCES, but we may succeed with a bigger buffer.

Keep retrying if getcwd(3) indicates lack of permissions until our
buffer can fit PATH_MAX bytes, as that's the maximum supported by the
syscall on FreeBSD anyway.  This way we do what we can to be able to
benefit from the syscall, but we also won't loop forever if there is a
real permission issue.

This fixes a regression introduced with 7333ed17 (setup: convert
setup_git_directory_gently_1 et al. to strbuf, 2014-07-28) for paths
longer than 127 bytes with components that miss read or execute
permissions (e.g. 0711 on /home for privacy reasons); we used a fixed
PATH_MAX-sized buffer before.

Reported-by: Zenobiusz Kunegunda &lt;zenobiusz.kunegunda@interia.pl&gt;
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>strbuf: add strbuf_add_real_path()</title>
<updated>2017-02-27T19:02:06Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-02-25T16:00:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=33ad9ddd0b5398063f0aabea639b5fe569f458ea'/>
<id>urn:sha1:33ad9ddd0b5398063f0aabea639b5fe569f458ea</id>
<content type='text'>
Add a function for appending the canonized absolute pathname of a given
path to a strbuf.  It keeps the existing contents intact, as expected of
a function of the strbuf_add() family, while avoiding copying the result
if the given strbuf is empty.  It's more consistent with the rest of the
strbuf API than strbuf_realpath(), which it's wrapping.

Also add a semantic patch demonstrating its intended usage and apply it
to the current tree.  Using strbuf_add_real_path() instead of calling
strbuf_addstr() and real_path() avoids an extra copy to a static buffer.

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>
</feed>
