<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/tests/clar_libgit2.c, branch ethomson/util</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>str: introduce `git_str` for internal, `git_buf` is external</title>
<updated>2021-09-30T16:42:46+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2021-09-07T21:53:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=fe07fa64878f3b7dfc7ed2964c3d45fd2fd6be7f'/>
<id>fe07fa64878f3b7dfc7ed2964c3d45fd2fd6be7f</id>
<content type='text'>
libgit2 has two distinct requirements that were previously solved by
`git_buf`.  We require:

1. A general purpose string class that provides a number of utility APIs
   for manipulating data (eg, concatenating, truncating, etc).
2. A structure that we can use to return strings to callers that they
   can take ownership of.

By using a single class (`git_buf`) for both of these purposes, we have
confused the API to the point that refactorings are difficult and
reasoning about correctness is also difficult.

Move the utility class `git_buf` to be called `git_str`: this represents
its general purpose, as an internal string buffer class.  The name also
is an homage to Junio Hamano ("gitstr").

The public API remains `git_buf`, and has a much smaller footprint.  It
is generally only used as an "out" param with strict requirements that
follow the documentation.  (Exceptions exist for some legacy APIs to
avoid breaking callers unnecessarily.)

Utility functions exist to convert a user-specified `git_buf` to a
`git_str` so that we can call internal functions, then converting it
back again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
libgit2 has two distinct requirements that were previously solved by
`git_buf`.  We require:

1. A general purpose string class that provides a number of utility APIs
   for manipulating data (eg, concatenating, truncating, etc).
2. A structure that we can use to return strings to callers that they
   can take ownership of.

By using a single class (`git_buf`) for both of these purposes, we have
confused the API to the point that refactorings are difficult and
reasoning about correctness is also difficult.

Move the utility class `git_buf` to be called `git_str`: this represents
its general purpose, as an internal string buffer class.  The name also
is an homage to Junio Hamano ("gitstr").

The public API remains `git_buf`, and has a much smaller footprint.  It
is generally only used as an "out" param with strict requirements that
follow the documentation.  (Exceptions exist for some legacy APIs to
avoid breaking callers unnecessarily.)

Utility functions exist to convert a user-specified `git_buf` to a
`git_str` so that we can call internal functions, then converting it
back again.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix the `-DENABLE_WERROR=ON` build for gcc 10.2</title>
<updated>2020-12-21T15:02:54+00:00</updated>
<author>
<name>lhchavez</name>
<email>lhchavez@lhchavez.com</email>
</author>
<published>2020-12-21T14:48:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=212ae9a70eddf3a77783d5cdffd3418273bfedd7'/>
<id>212ae9a70eddf3a77783d5cdffd3418273bfedd7</id>
<content type='text'>
This change makes it possible to build with newer versions of gcc
without warnings. There were two warnings issued:

* gcc 8 added
  [`-Wstringop-truncation`](https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/),
  which warns if a call to `strncpy(3)` is prone to accidentally
  truncating the destination string, since `strncpy(3)` does NOT add a
  terminating `NULL` if the destination buffer is not large enough to
  hold the input.

  This change uses the pattern suggested in
  https://us-cert.cisa.gov/bsi/articles/knowledge/coding-practices/strncpy-and-strncat
  to fix the locations flagged by gcc.
* There was a potentially uninitialized access of `dest` in `fs_copy`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change makes it possible to build with newer versions of gcc
without warnings. There were two warnings issued:

* gcc 8 added
  [`-Wstringop-truncation`](https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/),
  which warns if a call to `strncpy(3)` is prone to accidentally
  truncating the destination string, since `strncpy(3)` does NOT add a
  terminating `NULL` if the destination buffer is not large enough to
  hold the input.

  This change uses the pattern suggested in
  https://us-cert.cisa.gov/bsi/articles/knowledge/coding-practices/strncpy-and-strncat
  to fix the locations flagged by gcc.
* There was a potentially uninitialized access of `dest` in `fs_copy`.
</pre>
</div>
</content>
</entry>
<entry>
<title>clar: include the function name</title>
<updated>2020-06-05T07:49:07+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-06-05T07:42:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=cad7a1bad40c302fef02306708f6ce6279680cb4'/>
<id>cad7a1bad40c302fef02306708f6ce6279680cb4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>git_error: use new names in internal APIs and usage</title>
<updated>2019-01-22T22:30:35+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2018-12-27T19:47:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=f673e232afe22eb865cdc915e55a2df6493f0fbb'/>
<id>f673e232afe22eb865cdc915e55a2df6493f0fbb</id>
<content type='text'>
Move to the `git_error` name in the internal API for error-related
functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move to the `git_error` name in the internal API for error-related
functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: add a helper to build sandbox subpaths quickly</title>
<updated>2018-06-29T12:39:13+00:00</updated>
<author>
<name>Etienne Samson</name>
<email>samson.etienne@gmail.com</email>
</author>
<published>2018-06-29T12:39:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=d0921127c9ff2baaa8a766de43d3921933ad919d'/>
<id>d0921127c9ff2baaa8a766de43d3921933ad919d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>mailmap: API and style cleanup</title>
<updated>2018-06-15T05:43:28+00:00</updated>
<author>
<name>Nika Layzell</name>
<email>nika@thelayzells.com</email>
</author>
<published>2018-03-28T02:48:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=18ff9babd7476097a67e122b9126c878f98ff47f'/>
<id>18ff9babd7476097a67e122b9126c878f98ff47f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>mailmap: Switch mailmap parsing to use the git_parse module</title>
<updated>2018-06-15T05:43:27+00:00</updated>
<author>
<name>Nika Layzell</name>
<email>nika@thelayzells.com</email>
</author>
<published>2018-03-26T19:05:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=57cfeab9fe480591e3f56d61ccfbb68f9b500156'/>
<id>57cfeab9fe480591e3f56d61ccfbb68f9b500156</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>mailmap: Support path fixtures in cl_git_repository_init()</title>
<updated>2018-06-15T05:43:27+00:00</updated>
<author>
<name>Nika Layzell</name>
<email>nika@thelayzells.com</email>
</author>
<published>2018-03-17T22:14:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=939d8d579dcf722ca56578203df7c3134ba23ac1'/>
<id>939d8d579dcf722ca56578203df7c3134ba23ac1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert usage of `git_buf_free` to new `git_buf_dispose`</title>
<updated>2018-06-10T17:34:37+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2018-02-08T11:14:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=ecf4f33a4e327a91496f72816f9f02d923e5af05'/>
<id>ecf4f33a4e327a91496f72816f9f02d923e5af05</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: provide better pass/failure error messages</title>
<updated>2017-02-17T12:58:57+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@github.com</email>
</author>
<published>2017-02-17T12:13:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=a1dcc83030f9073fe29054ecaf7647dca1fec2ec'/>
<id>a1dcc83030f9073fe29054ecaf7647dca1fec2ec</id>
<content type='text'>
Provide more detailed messages when conditions pass or fail
unexpectedly.  In particular, this provides the error messages when a
test fails with a different error code than was expected.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide more detailed messages when conditions pass or fail
unexpectedly.  In particular, this provides the error messages when a
test fails with a different error code than was expected.
</pre>
</div>
</content>
</entry>
</feed>
