<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/config_parse.c, branch ethomson/proxy</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>config: variables might appear on the same line as a section header</title>
<updated>2018-10-15T10:46:28+00:00</updated>
<author>
<name>Carlos Martín Nieto</name>
<email>cmn@dwim.me</email>
</author>
<published>2018-09-28T09:55:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=1d718fa59a22c1f3d77be7007451d83bf83b7f57'/>
<id>1d718fa59a22c1f3d77be7007451d83bf83b7f57</id>
<content type='text'>
While rare and a machine would typically not generate such a configuration file,
it is nevertheless valid to write

    [foo "bar"] baz = true

and we need to deal with that instead of assuming everything is on its own line.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While rare and a machine would typically not generate such a configuration file,
it is nevertheless valid to write

    [foo "bar"] baz = true

and we need to deal with that instead of assuming everything is on its own line.
</pre>
</div>
</content>
</entry>
<entry>
<title>config: introduce new read-only in-memory backend</title>
<updated>2018-09-28T09:14:13+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2018-08-10T17:38:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=2be39cefd3ce1fecd4cd76122f8574c53add4dd2'/>
<id>2be39cefd3ce1fecd4cd76122f8574c53add4dd2</id>
<content type='text'>
Now that we have abstracted away how to store and retrieve config
entries, it became trivial to implement a new in-memory backend by
making use of this. And thus we do so.

This commit implements a new read-only in-memory backend that can parse
a chunk of memory into a `git_config_backend` structure.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that we have abstracted away how to store and retrieve config
entries, it became trivial to implement a new in-memory backend by
making use of this. And thus we do so.

This commit implements a new read-only in-memory backend that can parse
a chunk of memory into a `git_config_backend` structure.
</pre>
</div>
</content>
</entry>
<entry>
<title>config_parse: avoid unused static declared values</title>
<updated>2018-09-21T10:11:06+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2018-08-10T17:23:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=b9affa329a18d076094442d5af30e294c8fe8722'/>
<id>b9affa329a18d076094442d5af30e294c8fe8722</id>
<content type='text'>
The variables `git_config_escaped` and `git_config_escapes` are both
defined as static const character pointers in "config_parse.h". In case
where "config_parse.h" is included but those two variables are not being
used, the compiler will thus complain about defined but unused
variables. Fix this by declaring them as external and moving the actual
initialization to the C file.

Note that it is not possible to simply make this a #define, as we are
indexing into those arrays.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The variables `git_config_escaped` and `git_config_escapes` are both
defined as static const character pointers in "config_parse.h". In case
where "config_parse.h" is included but those two variables are not being
used, the compiler will thus complain about defined but unused
variables. Fix this by declaring them as external and moving the actual
initialization to the C file.

Note that it is not possible to simply make this a #define, as we are
indexing into those arrays.
</pre>
</div>
</content>
</entry>
<entry>
<title>config_parse: refactor error handling when parsing multiline variables</title>
<updated>2018-09-03T08:52:44+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2018-09-03T08:49:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=bc63e1ef521ab5900dc0b0dcd578b8bf18627fb1'/>
<id>bc63e1ef521ab5900dc0b0dcd578b8bf18627fb1</id>
<content type='text'>
The current error handling for the multiline variable parser is a bit
fragile, as each error condition has its own code to clear memory.
Instead, unify error handling as far as possible to avoid this
repetitive code. While at it, make use of `GITERR_CHECK_ALLOC` to
correctly handle OOM situations and verify that the buffer we print into
does not run out of memory either.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current error handling for the multiline variable parser is a bit
fragile, as each error condition has its own code to clear memory.
Instead, unify error handling as far as possible to avoid this
repetitive code. While at it, make use of `GITERR_CHECK_ALLOC` to
correctly handle OOM situations and verify that the buffer we print into
does not run out of memory either.
</pre>
</div>
</content>
</entry>
<entry>
<title>config: Fix a leak parsing multi-line config entries</title>
<updated>2018-09-01T03:50:26+00:00</updated>
<author>
<name>Nelson Elhage</name>
<email>nelhage@nelhage.com</email>
</author>
<published>2018-09-01T03:50:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=38b852558eb518f96c313cdcd9ce5a7af6ded194'/>
<id>38b852558eb518f96c313cdcd9ce5a7af6ded194</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>config: convert unbounded recursion into a loop</title>
<updated>2018-08-25T17:08:04+00:00</updated>
<author>
<name>Nelson Elhage</name>
<email>nelhage@nelhage.com</email>
</author>
<published>2018-08-25T17:04:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=a03113e80332fba6c77f43b21d398caad50b4b89'/>
<id>a03113e80332fba6c77f43b21d398caad50b4b89</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a double-free in config parsing</title>
<updated>2018-08-05T03:16:44+00:00</updated>
<author>
<name>Nelson Elhage</name>
<email>nelhage@nelhage.com</email>
</author>
<published>2018-07-22T23:47:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=b8a67eda0c95a7c7f63efb37872a15c21fe69c2d'/>
<id>b8a67eda0c95a7c7f63efb37872a15c21fe69c2d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>config_parse: always sanitize out-parameters in `parse_variable`</title>
<updated>2018-06-22T07:47:07+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-11-12T14:09:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=83b5f161facf117681df47cbeeb13b95dc3ea9c5'/>
<id>83b5f161facf117681df47cbeeb13b95dc3ea9c5</id>
<content type='text'>
The `parse_variable` function has two out parameters `var_name` and
`var_value`. Currently, those are not being sanitized to `NULL`. when.
any error happens inside of the `parse_variable` function. Fix that.
While at it, the coding style is improved to match our usual coding
practices more closely.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `parse_variable` function has two out parameters `var_name` and
`var_value`. Currently, those are not being sanitized to `NULL`. when.
any error happens inside of the `parse_variable` function. Fix that.
While at it, the coding style is improved to match our usual coding
practices more closely.
</pre>
</div>
</content>
</entry>
<entry>
<title>config_parse: have `git_config_parse` own entry value and name</title>
<updated>2018-06-22T07:44:52+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-11-12T13:59:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=e51e29e84c16f7a5d9079c2dc645301a54fdb172'/>
<id>e51e29e84c16f7a5d9079c2dc645301a54fdb172</id>
<content type='text'>
The function `git_config_parse` uses several callbacks to pass data
along to the caller as it parses the file. One design shortcoming here
is that strings passed to those callbacks are expected to be freed by
them, which is really confusing.

Fix the issue by changing memory ownership here. Instead of expecting
the `on_variable` callbacks to free memory for `git_config_parse`, just
do it inside of `git_config_parse`. While this obviously requires a bit
more memory allocation churn due to having to copy both name and value
at some places, this shouldn't be too much of a burden.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function `git_config_parse` uses several callbacks to pass data
along to the caller as it parses the file. One design shortcoming here
is that strings passed to those callbacks are expected to be freed by
them, which is really confusing.

Fix the issue by changing memory ownership here. Instead of expecting
the `on_variable` callbacks to free memory for `git_config_parse`, just
do it inside of `git_config_parse`. While this obviously requires a bit
more memory allocation churn due to having to copy both name and value
at some places, this shouldn't be too much of a burden.
</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>
</feed>
