<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/strbuf.h, branch v2.4.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.4.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.4.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-01-16T22:40:47Z</updated>
<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>
<entry>
<title>strbuf.h: unify documentation comments beginnings</title>
<updated>2015-01-16T22:40:46Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2015-01-16T09:04:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6afbbdda3339349feae91161f4e530d511c4db76'/>
<id>urn:sha1:6afbbdda3339349feae91161f4e530d511c4db76</id>
<content type='text'>
The prior patch uses "/**" to denote "documentation"
comments that we pulled from api-strbuf.txt. Let's use a
consistent style for similar comments that were already in
strbuf.h.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&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>strbuf.h: integrate api-strbuf.txt documentation</title>
<updated>2015-01-16T22:40:46Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-01-16T09:04:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bdfdaa4978dd92992737e662f25adc01d32d0774'/>
<id>urn:sha1:bdfdaa4978dd92992737e662f25adc01d32d0774</id>
<content type='text'>
Some of strbuf is documented as comments above functions,
and some is separate in Documentation/technical/api-strbuf.txt.
This makes it annoying to find the appropriate documentation.
We'd rather have it all in one place, which means all in the
text document, or all in the header.

Let's choose the header as that place. Even though the
formatting is not quite as pretty, this keeps the
documentation close to the related code.  The hope is that
this makes it easier to find what you want (human-readable
comments are right next to the C declarations), and easier
for writers to keep the documentation up to date.

This is more or less a straight import of the text from
api-strbuf.txt into C comments, complete with asciidoc
formatting. The exceptions are:

 1. All comments created in this way are started with "/**"
    to indicate they are part of the API documentation. This
    may help later with extracting the text to pretty-print
    it.

 2. Function descriptions do not repeat the function name,
    as it is available in the context directly below.  So:

      `strbuf_add`::

          Add data of given length to the buffer.

    from api-strbuf.txt becomes:

      /**
       * Add data of given length to the buffer.
       */
      void strbuf_add(struct strbuf *sb, const void *, size_t);

    As a result, any block-continuation required in asciidoc
    for that list item was dropped in favor of straight
    blank-line paragraph (since it is not necessary when we
    are not in a list item).

 3. There is minor re-wording to integrate existing comments
    and api-strbuf text. In each case, I took whichever
    version was more descriptive, and eliminated any
    redundancies. In one case, for strbuf_addstr, the api
    documentation gave its inline definition; I eliminated
    this as redundant with the actual definition, which can
    be seen directly below the comment.

 4. The functions in the header file are re-ordered to match
    the ordering of the API documentation, under the
    assumption that more thought went into the grouping
    there.

Helped-by: Jonathan Nieder &lt;jrnieder@gmail.com&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>Merge branch 'rs/export-strbuf-addchars'</title>
<updated>2014-09-19T18:38:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-19T18:38:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=56feed1c7641bbf7920efe6607c6a04309073baa'/>
<id>urn:sha1:56feed1c7641bbf7920efe6607c6a04309073baa</id>
<content type='text'>
Code clean-up.

* rs/export-strbuf-addchars:
  strbuf: use strbuf_addchars() for adding a char multiple times
  strbuf: export strbuf_addchars()
</content>
</entry>
<entry>
<title>strbuf: export strbuf_addchars()</title>
<updated>2014-09-08T18:26:45Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-09-07T07:03:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d07235a027e0c7ed2fee1aeb3bee8a858bf5ca58'/>
<id>urn:sha1:d07235a027e0c7ed2fee1aeb3bee8a858bf5ca58</id>
<content type='text'>
Move strbuf_addchars() to strbuf.c, where it belongs, and make it
available for other callers.

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/strbuf-getcwd'</title>
<updated>2014-09-02T20:28:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-02T20:27:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f655651e09b9fa7bf8ff13f1b4a5b16c7956e4cf'/>
<id>urn:sha1:f655651e09b9fa7bf8ff13f1b4a5b16c7956e4cf</id>
<content type='text'>
Reduce the use of fixed sized buffer passed to getcwd() calls
by introducing xgetcwd() helper.

* rs/strbuf-getcwd:
  use strbuf_add_absolute_path() to add absolute paths
  abspath: convert absolute_path() to strbuf
  use xgetcwd() to set $GIT_DIR
  use xgetcwd() to get the current directory or die
  wrapper: add xgetcwd()
  abspath: convert real_path_internal() to strbuf
  abspath: use strbuf_getcwd() to remember original working directory
  setup: convert setup_git_directory_gently_1 et al. to strbuf
  unix-sockets: use strbuf_getcwd()
  strbuf: add strbuf_getcwd()
</content>
</entry>
</feed>
