<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/tests/config/read.c, branch ethomson/codespaces</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-10-17T13:49:01+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=f0e693b18afbe1de37d7da5b5a8967b6c87d8e53'/>
<id>f0e693b18afbe1de37d7da5b5a8967b6c87d8e53</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>Add test config parsing</title>
<updated>2021-09-09T19:51:52+00:00</updated>
<author>
<name>Basile Henry</name>
<email>bjm.henry@gmail.com</email>
</author>
<published>2021-09-09T19:51:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=5eab4dafbe441ef22f06bb1eae6f544a862b822b'/>
<id>5eab4dafbe441ef22f06bb1eae6f544a862b822b</id>
<content type='text'>
This tests parsing a multiline string containing multiple quoted comment
chars. See #6019
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This tests parsing a multiline string containing multiple quoted comment
chars. See #6019
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: change comments to c89 style</title>
<updated>2021-08-29T10:19:49+00:00</updated>
<author>
<name>Peter Pettersson</name>
<email>boretrk@hotmail.com</email>
</author>
<published>2021-08-29T10:19:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=d17e67e6ab2765ce2c83fdf174d28e64400b7218'/>
<id>d17e67e6ab2765ce2c83fdf174d28e64400b7218</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve formatting</title>
<updated>2020-09-09T13:41:12+00:00</updated>
<author>
<name>Sven Strickroth</name>
<email>email@cs-ware.de</email>
</author>
<published>2020-09-09T13:41:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=c464f123f6b7d63075ca2c463f973ea03aa47713'/>
<id>c464f123f6b7d63075ca2c463f973ea03aa47713</id>
<content type='text'>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add boolean tests for "on" and "off"</title>
<updated>2020-09-09T13:38:20+00:00</updated>
<author>
<name>Sven Strickroth</name>
<email>email@cs-ware.de</email>
</author>
<published>2020-09-09T13:38:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=b97f41dba11982e90f8a4ca40a2640437800d537'/>
<id>b97f41dba11982e90f8a4ca40a2640437800d537</id>
<content type='text'>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Support empty values for git_config_get_mapped and git_config_lookup_map_value</title>
<updated>2020-09-09T11:22:38+00:00</updated>
<author>
<name>Sven Strickroth</name>
<email>email@cs-ware.de</email>
</author>
<published>2020-09-09T10:26:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=36cf1db281c24d0a2fee1af3a7a80adbd263e1cb'/>
<id>36cf1db281c24d0a2fee1af3a7a80adbd263e1cb</id>
<content type='text'>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix parsing boolean config values when using git_config_get_mapped and git_config_lookup_map_value</title>
<updated>2020-09-09T10:59:05+00:00</updated>
<author>
<name>Sven Strickroth</name>
<email>email@cs-ware.de</email>
</author>
<published>2020-09-09T09:55:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=86d04918c0a8f405ccb0b86b7ff8419dfb7a0bd7'/>
<id>86d04918c0a8f405ccb0b86b7ff8419dfb7a0bd7</id>
<content type='text'>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Sven Strickroth &lt;email@cs-ware.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>config: test that unreadable files are treated as notfound</title>
<updated>2020-06-01T11:21:29+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-05-23T10:42:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=9df69223b13f59032fd295124666c6a5627a450a'/>
<id>9df69223b13f59032fd295124666c6a5627a450a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>config: validate quoted section value</title>
<updated>2019-05-22T09:47:30+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-05-16T08:37:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=23c5699eb78724c4bdd8d2afcb7e49f32fbac6fb'/>
<id>23c5699eb78724c4bdd8d2afcb7e49f32fbac6fb</id>
<content type='text'>
When we reach a whitespace after a section name, we assume that what
will follow will be a quoted subsection name.  Pass the current position
of the line being parsed to the subsection parser, so that it can
validate that subsequent characters are additional whitespace or a
single quote.

Previously we would begin parsing after the section name, looking for
the first quotation mark.  This allows invalid characters to embed
themselves between the end of the section name and the first quotation
mark, eg `[section foo "subsection"]`, which is illegal.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we reach a whitespace after a section name, we assume that what
will follow will be a quoted subsection name.  Pass the current position
of the line being parsed to the subsection parser, so that it can
validate that subsequent characters are additional whitespace or a
single quote.

Previously we would begin parsing after the section name, looking for
the first quotation mark.  This allows invalid characters to embed
themselves between the end of the section name and the first quotation
mark, eg `[section foo "subsection"]`, which is illegal.
</pre>
</div>
</content>
</entry>
<entry>
<title>config: fix adding files if their parent directory is a file</title>
<updated>2018-11-28T12:42:00+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2018-11-28T12:36:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=43cbe6b7175266e05e2a58cdb233b3aca71bf19f'/>
<id>43cbe6b7175266e05e2a58cdb233b3aca71bf19f</id>
<content type='text'>
When we try to add a configuration file with `git_config_add_file_ondisk`, we
treat nonexisting files as empty. We do this by performing a stat call, ignoring
ENOENT errors. This works just fine in case the file or any of its parents
simply does not exist, but there is also the case where any of the parent
directories is not a directory, but a file. So e.g. trying to add a
configuration file "/dev/null/.gitconfig" will fail, as `errno` will be ENOTDIR
instead of ENOENT.

Catch ENOTDIR in addition to ENOENT to fix the issue. Add a test that verifies
we are able to add configuration files with such an invalid path file just fine.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we try to add a configuration file with `git_config_add_file_ondisk`, we
treat nonexisting files as empty. We do this by performing a stat call, ignoring
ENOENT errors. This works just fine in case the file or any of its parents
simply does not exist, but there is also the case where any of the parent
directories is not a directory, but a file. So e.g. trying to add a
configuration file "/dev/null/.gitconfig" will fail, as `errno` will be ENOTDIR
instead of ENOENT.

Catch ENOTDIR in addition to ENOENT to fix the issue. Add a test that verifies
we are able to add configuration files with such an invalid path file just fine.
</pre>
</div>
</content>
</entry>
</feed>
