<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/strbuf.h, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-08-03T18:01:27Z</updated>
<entry>
<title>Merge branch 'jk/date-mode-format'</title>
<updated>2015-08-03T18:01:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-03T18:01:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d939af12bd96db7ad3e671a0585ad8570aa7e9d3'/>
<id>urn:sha1:d939af12bd96db7ad3e671a0585ad8570aa7e9d3</id>
<content type='text'>
Teach "git log" and friends a new "--date=format:..." option to
format timestamps using system's strftime(3).

* jk/date-mode-format:
  strbuf: make strbuf_addftime more robust
  introduce "format" date-mode
  convert "enum date_mode" into a struct
  show-branch: use DATE_RELATIVE instead of magic number
</content>
</entry>
<entry>
<title>Merge branch 'mh/strbuf-read-file-returns-ssize-t'</title>
<updated>2015-07-13T21:00:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-07-13T21:00:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d790ba92cc534127fc4c0d58a901d1553835aa62'/>
<id>urn:sha1:d790ba92cc534127fc4c0d58a901d1553835aa62</id>
<content type='text'>
Avoid possible ssize_t to int truncation.

* mh/strbuf-read-file-returns-ssize-t:
  strbuf: strbuf_read_file() should return ssize_t
</content>
</entry>
<entry>
<title>strbuf: strbuf_read_file() should return ssize_t</title>
<updated>2015-07-04T01:25:02Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2015-07-03T13:59:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6c8afe495b2cb6e2069942d7c006f6660e186690'/>
<id>urn:sha1:6c8afe495b2cb6e2069942d7c006f6660e186690</id>
<content type='text'>
It is currently declared to return int, which could overflow for
large files.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>introduce "format" date-mode</title>
<updated>2015-06-29T18:39:10Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-06-25T16:55:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa1462cc3d3b0c4c8ad6a60aaf31e0f3a424162d'/>
<id>urn:sha1:aa1462cc3d3b0c4c8ad6a60aaf31e0f3a424162d</id>
<content type='text'>
This feeds the format directly to strftime. Besides being a
little more flexible, the main advantage is that your system
strftime may know more about your locale's preferred format
(e.g., how to spell the days of the week).

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>strbuf_addch: avoid calling strbuf_grow</title>
<updated>2015-04-16T15:15:05Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-04-16T08:53:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fec501dae8bf6c8fdcd4124c94f37c4cbc26ba29'/>
<id>urn:sha1:fec501dae8bf6c8fdcd4124c94f37c4cbc26ba29</id>
<content type='text'>
We mark strbuf_addch as inline, because we expect it may be
called from a tight loop. However, the first thing it does
is call the non-inline strbuf_grow(), which can handle
arbitrary-sized growth. Since we know that we only need a
single character, we can use the inline strbuf_avail() to
quickly check whether we need to grow at all.

Our check is redundant when we do call strbuf_grow(), but
that's OK. The common case is that we avoid calling it at
all, and we have made that case faster.

On a silly pathological case:

  perl -le '
    print "[core]";
    print "key$_ = value$_" for (1..1000000)
  ' &gt;input
  git config -f input core.key1

this dropped the time to run git-config from:

  real    0m0.159s
  user    0m0.152s
  sys     0m0.004s

to:

  real    0m0.140s
  user    0m0.136s
  sys     0m0.004s

for a savings of 12%.

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>strbuf.h: group documentation for trim functions</title>
<updated>2015-01-16T22:40:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-01-16T09:06:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d468fa2721d1ff918c0991e9e1f762872b3f82ae'/>
<id>urn:sha1:d468fa2721d1ff918c0991e9e1f762872b3f82ae</id>
<content type='text'>
The relationship between these makes more sense if you read
them as a group, which can help people who are looking for
the right function. Let's give them a single comment.

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>strbuf.h: drop boilerplate descriptions of strbuf_split_*</title>
<updated>2015-01-16T22:40:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-01-16T09:05:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f20e56e202fa2a6cd3faa1710ed9f600ba58ce1d'/>
<id>urn:sha1:f20e56e202fa2a6cd3faa1710ed9f600ba58ce1d</id>
<content type='text'>
The description of strbuf_split_buf says most of what
needs to be said for all of the split variants that take
strings, raw memory, etc. We have a boilerplate comment
above each that points to the first. This boilerplate
ends up making it harder to read, because it spaces out the
functions, which could otherwise be read as a group.

Let's drop the boilerplate completely, and mention the
variants in the top comment. This is perhaps slightly worse
for a hypothetical system which pulls the documentation for
each function out of the comment immediately preceding it.
But such a system does not yet exist, and anyway, the end
result of extracting the boilerplate comments would not lead
to a very easy-to-read result.  We would do better in the
long run to teach the extraction system about groups of
related functions.

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>strbuf.h: reorganize api function grouping headers</title>
<updated>2015-01-16T22:40:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-01-16T09:05:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=14e2177a40ca5861f0518cb6bbe0a6856ffa7552'/>
<id>urn:sha1:14e2177a40ca5861f0518cb6bbe0a6856ffa7552</id>
<content type='text'>
The original API doc had something like:

    Functions
    ---------

    * Life cycle

      ... some life-cycle functions ...

    * Related to the contents of the buffer

      ... functions related to contents ....

    etc

This grouping can be hard to read in the comment sources,
given the "*" in the comment lines, and the amount of text
between each section.

Instead, let's make a flat list of groupings, and underline
each as a section header. That makes them stand out, and
eliminates the weird half-phrase of "Related to...". Like:

    Functions related to the contents of the buffer
    -----------------------------------------------

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>strbuf.h: format asciidoc code blocks as 4-space indent</title>
<updated>2015-01-16T22:40:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-01-16T09:05:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=088c9a86ff5332ee15415be3408ccf34687bc2d2'/>
<id>urn:sha1:088c9a86ff5332ee15415be3408ccf34687bc2d2</id>
<content type='text'>
This is much easier to read when the whole thing is stuffed
inside a comment block. And there is precedent for this
convention in markdown (and just in general ascii text).

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>strbuf.h: drop asciidoc list formatting from API docs</title>
<updated>2015-01-16T22:40:46Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-01-16T09:05:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa07cac43fb03a01bcbcdffdaa49bf72a9eb06d1'/>
<id>urn:sha1:aa07cac43fb03a01bcbcdffdaa49bf72a9eb06d1</id>
<content type='text'>
Using a hanging indent is much more readable. This means we
won't format as asciidoc anymore, but since we don't have a
working system for extracting these comments anyway, it's
probably more important to just make the source readable.

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