<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/tests/iterator, 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>tests: don't generate false positives on empty path segments</title>
<updated>2021-08-08T11:34:06+00:00</updated>
<author>
<name>Peter Pettersson</name>
<email>boretrk@hotmail.com</email>
</author>
<published>2021-08-08T11:34:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=d095502ed797e20a73a00b65cc9d70d91f7d7ab4'/>
<id>d095502ed797e20a73a00b65cc9d70d91f7d7ab4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: iterator: fix iterator expecting too few items</title>
<updated>2020-02-07T13:36:10+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2020-02-07T13:36:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=26b71d605ca6bbc926b58992e20d75e589d9c4f7'/>
<id>26b71d605ca6bbc926b58992e20d75e589d9c4f7</id>
<content type='text'>
The testcase iterator::workdir::filesystem_gunk sets up quite a lot of
directories, which is why it only runs in case GITTEST_INVASIVE_SPEED is
set in the environment. Because we do not run our default CI with this
variable, we didn't notice commit 852c83ee4 (refs: refuse to delete
HEAD, 2020-01-15) breaking the test as it introduced a new reference to
the "testrepo" repository.

Fix the oversight by increasing the number of expected iterator items.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The testcase iterator::workdir::filesystem_gunk sets up quite a lot of
directories, which is why it only runs in case GITTEST_INVASIVE_SPEED is
set in the environment. Because we do not run our default CI with this
variable, we didn't notice commit 852c83ee4 (refs: refuse to delete
HEAD, 2020-01-15) breaking the test as it introduced a new reference to
the "testrepo" repository.

Fix the oversight by increasing the number of expected iterator items.
</pre>
</div>
</content>
</entry>
<entry>
<title>refs: refuse to delete HEAD</title>
<updated>2020-01-15T21:55:58+00:00</updated>
<author>
<name>Josh Bleecher Snyder</name>
<email>josharian@gmail.com</email>
</author>
<published>2020-01-15T21:31:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=852c83ee44d6d53137f12443c9f82f70bbabbadc'/>
<id>852c83ee44d6d53137f12443c9f82f70bbabbadc</id>
<content type='text'>
This requires adding a new symbolic ref to the testrepo fixture.
Some of the existing tests attempt to delete HEAD, expecting a different failure. Introduce and use a non-HEAD symbolic ref instead.
Adjust a few other tests as needed.

Fixes #5357</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This requires adding a new symbolic ref to the testrepo fixture.
Some of the existing tests attempt to delete HEAD, expecting a different failure. Introduce and use a non-HEAD symbolic ref instead.
Adjust a few other tests as needed.

Fixes #5357</pre>
</div>
</content>
</entry>
<entry>
<title>fileops: rename to "futils.h" to match function signatures</title>
<updated>2019-07-20T17:11:20+00:00</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2019-06-29T07:17:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=e54343a4024e75dfaa940e652c2c9799d33634b2'/>
<id>e54343a4024e75dfaa940e652c2c9799d33634b2</id>
<content type='text'>
Our file utils functions all have a "futils" prefix, e.g.
`git_futils_touch`. One would thus naturally guess that their
definitions and implementation would live in files "futils.h" and
"futils.c", respectively, but in fact they live in "fileops.h".

Rename the files to match expectations.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Our file utils functions all have a "futils" prefix, e.g.
`git_futils_touch`. One would thus naturally guess that their
definitions and implementation would live in files "futils.h" and
"futils.c", respectively, but in fact they live in "fileops.h".

Rename the files to match expectations.
</pre>
</div>
</content>
</entry>
<entry>
<title>attr: ensure regular attr files can have whitespace</title>
<updated>2019-05-24T14:16:43+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2019-05-19T14:34:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=4bcebe2c92d52739e2ea7a92abb26df32ffc2423'/>
<id>4bcebe2c92d52739e2ea7a92abb26df32ffc2423</id>
<content type='text'>
Unlike ignore files, gitattribute files can have flexible whitespace at
the beginning of the line.  Ensure that by adding new ignore rules that
we have not impeded correct parsing of attribute files.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unlike ignore files, gitattribute files can have flexible whitespace at
the beginning of the line.  Ensure that by adding new ignore rules that
we have not impeded correct parsing of attribute files.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: fix test expectation mismatch</title>
<updated>2019-01-14T00:25:05+00:00</updated>
<author>
<name>Etienne Samson</name>
<email>samson.etienne@gmail.com</email>
</author>
<published>2019-01-14T00:25:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=54ae052859a63058e41b925bfa028c1d66343c4b'/>
<id>54ae052859a63058e41b925bfa028c1d66343c4b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>index: use new enum and structure names</title>
<updated>2018-12-01T10:46:44+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2018-11-28T13:31:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=18e71e6d597abe6c7feb666429c921bd19dc0ba8'/>
<id>18e71e6d597abe6c7feb666429c921bd19dc0ba8</id>
<content type='text'>
Use the new-style index names throughout our own codebase.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the new-style index names throughout our own codebase.
</pre>
</div>
</content>
</entry>
<entry>
<title>iterator: optionally hash filesystem iterators</title>
<updated>2018-11-03T16:42:53+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2018-03-19T19:45:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=2b12dcf6d6971a622abe9730472dc373c0856d98'/>
<id>2b12dcf6d6971a622abe9730472dc373c0856d98</id>
<content type='text'>
Optionally hash the contents of files encountered in the filesystem or
working directory iterators.  This is not expected to be used in
production code paths, but may allow us to simplify some test contexts.

For working directory iterators, apply filters as appropriate, since we
have the context able to do it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Optionally hash the contents of files encountered in the filesystem or
working directory iterators.  This is not expected to be used in
production code paths, but may allow us to simplify some test contexts.

For working directory iterators, apply filters as appropriate, since we
have the context able to do it.
</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>
