<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t4018-diff-funcname.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>userdiff: fix leaking memory for configured diff drivers</title>
<updated>2024-08-14T17:08:01Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-08-14T06:52:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=38678e5df55b77e98b47e7847faf83451eb161de'/>
<id>urn:sha1:38678e5df55b77e98b47e7847faf83451eb161de</id>
<content type='text'>
The userdiff structures may be initialized either statically on the
stack or dynamically via configuration keys. In the latter case we end
up leaking memory because we didn't have any infrastructure to discern
those strings which have been allocated statically and those which have
been allocated dynamically.

Refactor the code such that we have two pointers for each of these
strings: one that holds the value as accessed by other subsystems, and
one that points to the same string in case it has been allocated. Like
this, we can safely free the second pointer and thus plug those memory
leaks.

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>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>attr: teach "--attr-source=&lt;tree&gt;" global option to "git"</title>
<updated>2023-05-06T21:34:09Z</updated>
<author>
<name>John Cai</name>
<email>johncai86@gmail.com</email>
</author>
<published>2023-05-06T04:15:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44451a2e5eec5360378be23e2cdbd9ecee49e14e'/>
<id>urn:sha1:44451a2e5eec5360378be23e2cdbd9ecee49e14e</id>
<content type='text'>
Earlier, 47cfc9bd (attr: add flag `--source` to work with tree-ish,
2023-01-14) taught "git check-attr" the "--source=&lt;tree&gt;" option to
allow it to read attribute files from a tree-ish, but did so only
for the command.  Just like "check-attr" users wanted a way to use
attributes from a tree-ish and not from the working tree files,
users of other commands (like "git diff") would benefit from the
same.

Undo most of the UI change the commit made, while keeping the
internal logic to read attributes from a given tree-ish. Expose the
internal logic via a new "--attr-source=&lt;tree&gt;" command line option
given to "git", so that it can be used with any git command that
runs as part of the main git process.

Additionally, add an environment variable GIT_ATTR_SOURCE that is set
when --attr-source is passed in, so that subprocesses use the same value
for the attributes source tree.

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>t4000-t4999: detect and signal failure within loop</title>
<updated>2021-12-13T18:29:48Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2021-12-09T05:11:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cbe1d9d630e529d3dd240eacf3d1c9799fef702b'/>
<id>urn:sha1:cbe1d9d630e529d3dd240eacf3d1c9799fef702b</id>
<content type='text'>
Failures within `for` and `while` loops can go unnoticed if not detected
and signaled manually since the loop itself does not abort when a
contained command fails, nor will a failure necessarily be detected when
the loop finishes since the loop returns the exit code of the last
command it ran on the final iteration, which may not be the command
which failed. Therefore, detect and signal failures manually within
loops using the idiom `|| return 1` (or `|| exit 1` within subshells).

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Reviewed-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff: remove support for "broken" tests</title>
<updated>2021-04-08T19:19:10Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-04-08T15:04:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6cb77966ec8e335fc21ac555a851b81598971ebf'/>
<id>urn:sha1:6cb77966ec8e335fc21ac555a851b81598971ebf</id>
<content type='text'>
There have been no "broken" tests since 75c3b6b2e8 (userdiff: improve
Fortran xfuncname regex, 2020-08-12). Let's remove the test support
for them.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff tests: list builtin drivers via test-tool</title>
<updated>2021-04-08T19:19:10Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-04-08T15:04:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=28e8f0d5e5a6db005fdb22c65ee0d43cf15c4b17'/>
<id>urn:sha1:28e8f0d5e5a6db005fdb22c65ee0d43cf15c4b17</id>
<content type='text'>
Change the userdiff test to list the builtin drivers via the
test-tool, using the new for_each_userdiff_driver() API function.

This gets rid of the need to modify this part of the test every time a
new pattern is added, see 2ff6c34612 (userdiff: support Bash,
2020-10-22) and 09dad9256a (userdiff: support Markdown, 2020-05-02)
for two recent examples.

I only need the "list-builtin-drivers "argument here, but let's add
"list-custom-drivers" and "list-drivers" too, just because it's easy.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff tests: explicitly test "default" pattern</title>
<updated>2021-04-08T19:19:10Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-04-08T15:04:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=132bf259890c1f5b29befcc68e9ed225187ca9f6'/>
<id>urn:sha1:132bf259890c1f5b29befcc68e9ed225187ca9f6</id>
<content type='text'>
Since 122aa6f9c0 (diff: introduce diff.&lt;driver&gt;.binary, 2008-10-05)
the internals of the userdiff.c code have understood a "default" name,
which is invoked as userdiff_find_by_name("default") and present in
the "builtin_drivers" struct. Let's test for this special case.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff: support Bash</title>
<updated>2020-10-22T17:29:30Z</updated>
<author>
<name>Victor Engmark</name>
<email>victor@engmark.name</email>
</author>
<published>2020-10-21T23:45:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2ff6c34612057baccbd841524106c5a05f6be6d6'/>
<id>urn:sha1:2ff6c34612057baccbd841524106c5a05f6be6d6</id>
<content type='text'>
Support POSIX, bashism and mixed function declarations, all four
compound command types, trailing comments and mixed whitespace.

Even though Bash allows locale-dependent characters in function names
&lt;https://unix.stackexchange.com/a/245336/3645&gt;, only detect function
names with characters allowed by POSIX.1-2017
&lt;https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_235&gt;
for simplicity. This should cover the vast majority of use cases, and
produces system-agnostic results.

Since a word pattern has to be specified, but there is no easy way to
know the default word pattern, use the default `IFS` characters for a
starter. A later patch can improve this.

Signed-off-by: Victor Engmark &lt;victor@engmark.name&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff: support Markdown</title>
<updated>2020-05-03T01:04:12Z</updated>
<author>
<name>Ash Holland</name>
<email>ash@sorrel.sh</email>
</author>
<published>2020-05-02T13:15:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=09dad9256a32affc4a3bc0cf1fa45d5fa6f51231'/>
<id>urn:sha1:09dad9256a32affc4a3bc0cf1fa45d5fa6f51231</id>
<content type='text'>
It's typical to find Markdown documentation alongside source code, and
having better context for documentation changes is useful; see also
commit 69f9c87d4 (userdiff: add support for Fountain documents,
2015-07-21).

The pattern is based on the CommonMark specification 0.29, section 4.2
&lt;https://spec.commonmark.org/&gt; but doesn't match empty headings, as
seeing them in a hunk header is unlikely to be useful.

Only ATX headings are supported, as detecting setext headings would
require printing the line before a pattern matches, or matching a
multiline pattern. The word-diff pattern is the same as the pattern for
HTML, because many Markdown parsers accept inline HTML.

Signed-off-by: Ash Holland &lt;ash@sorrel.sh&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
