<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t1404-update-ref-errors.sh, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-11-20T23:23:48Z</updated>
<entry>
<title>t: remove TEST_PASSES_SANITIZE_LEAK annotations</title>
<updated>2024-11-20T23:23:48Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-11-20T13:39:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fc1ddf42af6742fae7e770cae20e30d7902014c0'/>
<id>urn:sha1:fc1ddf42af6742fae7e770cae20e30d7902014c0</id>
<content type='text'>
Now that the default value for TEST_PASSES_SANITIZE_LEAK is `true` there
is no longer a need to have that variable declared in all of our tests.
Drop it.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t: convert some here-doc test bodies</title>
<updated>2024-07-10T17:14:23Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2024-07-10T08:39:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f6b75726b2779faa57bd590deb882d3da157f3be'/>
<id>urn:sha1:f6b75726b2779faa57bd590deb882d3da157f3be</id>
<content type='text'>
The t1404 script checks a lot of output from Git which contains single
quotes. Because the test snippets are themselves wrapped in the same
single-quotes, we have to resort to using $SQ to match them.  This is
error-prone and makes the tests harder to read.

Instead, let's use the new here-doc feature added in the previous
commit, which lets us write anything in the test body we want (except
the here-doc end marker on a line by itself, of course).

Note that we do use "\" in our marker to avoid interpolation (which is
the whole point). But we don't use "&lt;&lt;-", as we want to preserve
whitespace in the snippet (and running with "-v" before and after shows
that we produce the exact same output, except with the ugly $SQ
references fixed).

I just converted every test here, even though only some of them use
$SQ. But it would be equally correct to mix-and-match styles if we don't
mind the inconsistency.

I've also converted a few tests in t0600 which were moved from t1404 (I
had written this patch before they were moved, but it seemed worth
porting over the changes rather than losing them).

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>Switch grep from non-portable BRE to portable ERE</title>
<updated>2024-05-17T19:13:18Z</updated>
<author>
<name>Marcel Telka</name>
<email>marcel@telka.sk</email>
</author>
<published>2024-05-17T19:01:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0f063b6c766fc98124f60b6b0f8424142641ff88'/>
<id>urn:sha1:0f063b6c766fc98124f60b6b0f8424142641ff88</id>
<content type='text'>
This makes the grep usage fully POSIX compliant.  The ability to
enable ERE features in BRE using backslash is a GNU extension.

Signed-off-by: Marcel Telka &lt;marcel@telka.sk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t1404: make D/F conflict tests compatible with reftable backend</title>
<updated>2024-02-15T18:12:30Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-02-15T08:25:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3f87bb2c2b83faf7854db293457ed7c275e457e5'/>
<id>urn:sha1:3f87bb2c2b83faf7854db293457ed7c275e457e5</id>
<content type='text'>
Some of the tests in t1404 exercise whether Git correctly aborts
transactions when there is a directory/file conflict with ref names.
While these tests are all marked to require the "files" backend, they do
in fact apply to the "reftable" backend as well.

This may not make much sense on the surface: D/F conflicts only exist
because the "files" backend uses the filesystem to store loose refs, and
thus the restriction theoretically shouldn't apply to the "reftable"
backend. But for now, the "reftable" backend artificially restricts the
creation of such conflicting refs so that it is a drop-in replacement
for the "files" backend. This also ensures that the "reftable" backend
can easily be used on the server side without causing issues for clients
which only know to use the "files" backend.

The only difference between the "files" and "reftable" backends is a
slightly different error message. Adapt the tests to accomodate for this
difference and remove the REFFILES prerequisite so that we start testing
with both backends.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t1404: move reffiles specific tests to t0600</title>
<updated>2024-01-22T23:56:57Z</updated>
<author>
<name>John Cai</name>
<email>johncai86@gmail.com</email>
</author>
<published>2024-01-19T20:18:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=102d7154a0546e79fa54b758db835dcfdcd1df2e'/>
<id>urn:sha1:102d7154a0546e79fa54b758db835dcfdcd1df2e</id>
<content type='text'>
These tests modify loose refs manually and are specific to the reffiles
backend. Move these to t0600 to be part of a test suite of reffiles
specific tests.

Signed-off-by: John Cai &lt;johncai86@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: teach callers of test_i18ngrep to use test_grep</title>
<updated>2023-11-02T08:13:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-10-31T05:23:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6789275d3780bcb950e6be8557aeedf160d4ad6d'/>
<id>urn:sha1:6789275d3780bcb950e6be8557aeedf160d4ad6d</id>
<content type='text'>
They are equivalents and the former still exists, so as long as the
only change this commit makes are to rewrite test_i18ngrep to
test_grep, there won't be any new bug, even if there still are
callers of test_i18ngrep remaining in the tree, or when merged to
other topics that add new uses of test_i18ngrep.

This patch was produced more or less with

    git grep -l -e 'test_i18ngrep ' 't/t[0-9][0-9][0-9][0-9]-*.sh' |
    xargs perl -p -i -e 's/test_i18ngrep /test_grep /'

and a good way to sanity check the result yourself is to run the
above in a checkout of c4603c1c (test framework: further deprecate
test_i18ngrep, 2023-10-31) and compare the resulting working tree
contents with the result of applying this patch to the same commit.
You'll see that test_i18ngrep in a few t/lib-*.sh files corrected,
in addition to the manual reproduction.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t1404: don't create unused file</title>
<updated>2023-03-20T16:11:42Z</updated>
<author>
<name>Andrei Rybak</name>
<email>rybak.a.v@gmail.com</email>
</author>
<published>2023-03-18T15:46:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7deec9442f958891ed22f831c84a7c49a2a52d1a'/>
<id>urn:sha1:7deec9442f958891ed22f831c84a7c49a2a52d1a</id>
<content type='text'>
Some tests in file t1404-update-ref-errors.sh create file "unchanged" as
the expected side for a test_cmp assertion at the end of the test for
output of "git for-each-ref".  Test 'no bogus intermediate values during
delete' also creates a file named "unchanged" using "git for-each-ref".
However, the file isn't used for any assertions in the test.  Instead,
"git rev-parse" is used to compare the reference with variable $D.

Don't create unused file "unchanged" in test 'no bogus intermediate
values during delete' of t1404-update-ref-errors.sh.

Signed-off-by: Andrei Rybak &lt;rybak.a.v@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: discard partial cache before (re-)reading it</title>
<updated>2022-11-21T03:32:48Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-11-08T18:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=03267e8656c23cf1e2d1df8204d4cee236fb0077'/>
<id>urn:sha1:03267e8656c23cf1e2d1df8204d4cee236fb0077</id>
<content type='text'>
The read_cache() in prepare_to_commit() would end up clobbering the
pointer we had for a previously populated "the_index.cache_tree" in
the very common case of "git commit" stressed by e.g. the tests being
changed here.

We'd populate "the_index.cache_tree" by calling
"update_main_cache_tree" in prepare_index(), but would not end up with
a "fully prepared" index. What constitutes an existing index is
clearly overly fuzzy, here we'll check "active_nr" (aka
"the_index.cache_nr"), but our "the_index.cache_tree" might have been
malloc()'d already.

Thus the code added in 11c8a74a64a (commit: write cache-tree data when
writing index anyway, 2011-12-06) would end up allocating the
"cache_tree", and would interact here with code added in
7168624c353 (Do not generate full commit log message if it is not
going to be used, 2007-11-28). The result was a very common memory
leak.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
</content>
</entry>
<entry>
<title>t1404: mark directory/file conflict tests with REFFILES</title>
<updated>2021-11-29T23:09:32Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2021-11-29T18:20:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=911e9e88abeceb23fd6780d2cb6cf623957290a4'/>
<id>urn:sha1:911e9e88abeceb23fd6780d2cb6cf623957290a4</id>
<content type='text'>
The files backend uses file system locking on individual refs, which means a
directory/file conflict can prevent locks being taken. For example, in a repo
with just the ref "foo", an update

    (DELETE "foo") + (ADD "foo/bar")

cannot be executed in the files backend, as one cannot take a lock on foo/bar.

The current reftable proof-of-concept integration supports these tranactions, as
the result is a repo with just "foo/bar", which has no directory/file conflict.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t1404: mark tests that muck with .git directly as REFFILES.</title>
<updated>2021-06-02T01:01:55Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2021-05-31T16:56:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe8fc09f34c353b744d793d45c2ee62fb1a5f699'/>
<id>urn:sha1:fe8fc09f34c353b744d793d45c2ee62fb1a5f699</id>
<content type='text'>
The packed/loose ref storage is an overlay combination of packed-refs (refs and
tags in a single file) and one-file-per-ref. This creates all kinds of edge
cases related to directory/file conflicts, (non-)empty directories, and the
locking scheme, none of which applies to reftable.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Reviewed-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
