<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t4018, branch master</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=master</id>
<link rel='self' href='https://git.shady.money/git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-05-29T22:29:37Z</updated>
<entry>
<title>userdiff: add support for R programming language</title>
<updated>2025-05-29T22:29:37Z</updated>
<author>
<name>Rodrigo Carvalho</name>
<email>rodrigorsdc@gmail.com</email>
</author>
<published>2025-05-29T22:16:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1d9526df8d6ebe69efc54ade9d4ed2317342fdba'/>
<id>urn:sha1:1d9526df8d6ebe69efc54ade9d4ed2317342fdba</id>
<content type='text'>
Add userdiff patterns to support R programming language.

Also, add three userdiff tests for R programming language
files. These files define simple function and nested function,
with and without indentation.

Signed-off-by: Rodrigo Carvalho &lt;rodrigorsdc@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff: extend Bash pattern to cover more shell function forms</title>
<updated>2025-05-16T18:52:41Z</updated>
<author>
<name>Moumita Dhar</name>
<email>dhar61595@gmail.com</email>
</author>
<published>2025-05-16T14:45:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea8a71b40d3fdc91180b951c829cdf41bb6f7da0'/>
<id>urn:sha1:ea8a71b40d3fdc91180b951c829cdf41bb6f7da0</id>
<content type='text'>
The previous function regex required explicit matching of function
bodies using `{`, `(`, `((`, or `[[`, which caused several issues:

- It failed to capture valid functions where `{` was on the next line
  due to line continuation (`\`).
- It did not recognize functions with single  command body, such as
  `x () echo hello`.

Replacing the function body matching logic with `.*$`, ensures
that everything on the function definition line is captured.

Additionally, the word regex is refined to better recognize shell
syntax, including additional parameter expansion operators and
command-line options.

Signed-off-by: Moumita Dhar &lt;dhar61595@gmail.com&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: add builtin driver for INI files</title>
<updated>2025-04-01T10:02:09Z</updated>
<author>
<name>Lucas Seiki Oshiro</name>
<email>lucasseikioshiro@gmail.com</email>
</author>
<published>2025-03-31T03:13:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=43380056df44aed6e074689dc8bc940f9dc6e2c8'/>
<id>urn:sha1:43380056df44aed6e074689dc8bc940f9dc6e2c8</id>
<content type='text'>
Add a new builtin driver for generic INI files (e. g. the gitconfig
files), where:

- the funcname regular expression matches section names, i. e. any
  string between brackets at the beginning of the line, with or without
  indentation;

- word_regex matches any word with one or more non-whitespace
  characters without checking if it is a valid variable name or value.

Also add tests for the new userdiff driver. These files define sections
and subsections, with and without indentation.

Helped-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Helped-by: D. Ben Knoble &lt;ben.knoble@gmail.com&gt;
Signed-off-by: Lucas Seiki Oshiro &lt;lucasseikioshiro@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff: better method/property matching for C#</title>
<updated>2024-04-05T22:21:43Z</updated>
<author>
<name>Steven Jeuris</name>
<email>steven.jeuris@3shape.com</email>
</author>
<published>2024-04-03T21:42:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec0e3075d245afa3f3a848bd7bdc6376dea85fe0'/>
<id>urn:sha1:ec0e3075d245afa3f3a848bd7bdc6376dea85fe0</id>
<content type='text'>
- Support multi-line methods by not requiring closing parenthesis.
- Support multiple generics (comma was missing before).
- Add missing `foreach`, `lock` and  `fixed` keywords to skip over.
- Remove `instanceof` keyword, which isn't C#.
- Also detect non-method keywords not positioned at the start of a line.
- Added tests; none existed before.

The overall strategy is to focus more on what isn't expected for
method/property definitions, instead of what is, but is fully optional.

Signed-off-by: Steven Jeuris &lt;steven.jeuris@gmail.com&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 Java sealed classes</title>
<updated>2023-02-08T20:57:13Z</updated>
<author>
<name>Andrei Rybak</name>
<email>rybak.a.v@gmail.com</email>
</author>
<published>2023-02-07T23:42:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=93d52ed050f5613897b73e75961df5c589d63a4b'/>
<id>urn:sha1:93d52ed050f5613897b73e75961df5c589d63a4b</id>
<content type='text'>
A new kind of class was added in Java 17 -- sealed classes.[1]  This
feature includes several new keywords that may appear in a declaration
of a class.  New modifiers before name of the class: "sealed" and
"non-sealed", and a clause after name of the class marked by keyword
"permits".

The current set of regular expressions in userdiff.c already allows the
modifier "sealed" and the "permits" clause, but not the modifier
"non-sealed", which is the first hyphenated keyword in Java.[2]  Allow
hyphen in the words that precede the name of type to match the
"non-sealed" modifier.

In new input file "java-sealed" for the test t4018-diff-funcname.sh, use
a Java code comment for the marker "RIGHT".  This workaround is needed,
because the name of the sealed class appears on the line of code that
has the "ChangeMe" marker.

[1] Detailed description in "JEP 409: Sealed Classes"
    https://openjdk.org/jeps/409
[2] "JEP draft: Keyword Management for the Java Language"
    https://openjdk.org/jeps/8223002

Signed-off-by: Andrei Rybak &lt;rybak.a.v@gmail.com&gt;
Reviewed-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 Java record types</title>
<updated>2023-02-08T20:57:11Z</updated>
<author>
<name>Andrei Rybak</name>
<email>rybak.a.v@gmail.com</email>
</author>
<published>2023-02-07T23:42:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=575e6fcfcc961a64a222e0241cdc117d24f9ec87'/>
<id>urn:sha1:575e6fcfcc961a64a222e0241cdc117d24f9ec87</id>
<content type='text'>
A new kind of class was added in Java 16 -- records.[1]  The syntax of
records is similar to regular classes with one important distinction:
the name of the record class is followed by a mandatory list of
components.  The list is enclosed in parentheses, it may be empty, and
it may immediately follow the name of the class or type parameters, if
any, with or without separating whitespace.  For example:

    public record Example(int i, String s) {
    }

    public record WithTypeParameters&lt;A, B&gt;(A a, B b, String s) {
    }

    record SpaceBeforeComponents (String comp1, int comp2) {
    }

Support records in the builtin userdiff pattern for Java.  Add "record"
to the alternatives of keywords for kinds of class.

Allowing matching various possibilities for the type parameters and/or
list of the components of a record has already been covered by the
preceding patch.

[1] detailed description is available in "JEP 395: Records"
    https://openjdk.org/jeps/395

Signed-off-by: Andrei Rybak &lt;rybak.a.v@gmail.com&gt;
Reviewed-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 Java type parameters</title>
<updated>2023-02-08T20:56:57Z</updated>
<author>
<name>Andrei Rybak</name>
<email>rybak.a.v@gmail.com</email>
</author>
<published>2023-02-07T23:42:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=39226a8dacc866417be19b0a95b45e82d5975a84'/>
<id>urn:sha1:39226a8dacc866417be19b0a95b45e82d5975a84</id>
<content type='text'>
A class or interface in Java can have type parameters following the name
in the declared type, surrounded by angle brackets (paired less than and
greater than signs).[2]   The type parameters -- `A` and `B` in the
examples -- may follow the class name immediately:

    public class ParameterizedClass&lt;A, B&gt; {
    }

or may be separated by whitespace:

    public class SpaceBeforeTypeParameters &lt;A, B&gt; {
    }

A part of the builtin userdiff pattern for Java matches declarations of
classes, enums, and interfaces.  The regular expression requires at
least one whitespace character after the name of the declared type.
This disallows matching for opening angle bracket of type parameters
immediately after the name of the type.  Mandatory whitespace after the
name of the type also disallows using the pattern in repositories with a
fairly common code style that puts braces for the body of a class on
separate lines:

    class WithLineBreakBeforeOpeningBrace
    {
    }

Support matching Java code in more diverse code styles and declarations
of classes and interfaces with type parameters immediately following the
name of the type in the builtin userdiff pattern for Java.  Do so by
just matching anything until the end of the line after the keywords for
the kind of type being declared.

[1] Since Java 5 released in 2004.
[2] Detailed description is available in the Java Language
    Specification, sections "Type Variables" and "Parameterized Types":
    https://docs.oracle.com/javase/specs/jls/se17/html/jls-4.html#jls-4.4

Signed-off-by: Andrei Rybak &lt;rybak.a.v@gmail.com&gt;
Reviewed-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff: add builtin diff driver for kotlin language.</title>
<updated>2022-03-13T02:15:47Z</updated>
<author>
<name>Jaydeep P Das</name>
<email>jaydeepjd.8914@gmail.com</email>
</author>
<published>2022-03-12T04:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=09188ed930bcb08e56d1846fbf9f5cb972a2d188'/>
<id>urn:sha1:09188ed930bcb08e56d1846fbf9f5cb972a2d188</id>
<content type='text'>
The xfuncname pattern finds func/class declarations
in diffs to display as a hunk header. The word_regex
pattern finds individual tokens in Kotlin code to generate
appropriate diffs.

This patch adds xfuncname regex and word_regex for Kotlin
language.

Signed-off-by: Jaydeep P Das &lt;jaydeepjd.8914@gmail.com&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>Merge branch 'uk/userdiff-php-enum'</title>
<updated>2021-09-10T18:46:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-10T18:46:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6dbe1b4ee21bb52b2069fc0330915483ec020386'/>
<id>urn:sha1:6dbe1b4ee21bb52b2069fc0330915483ec020386</id>
<content type='text'>
Update the userdiff pattern for PHP.

* uk/userdiff-php-enum:
  userdiff: support enum keyword in PHP hunk header
</content>
</entry>
<entry>
<title>userdiff: support enum keyword in PHP hunk header</title>
<updated>2021-08-31T19:13:36Z</updated>
<author>
<name>USAMI Kenta</name>
<email>tadsan@zonu.me</email>
</author>
<published>2021-08-31T06:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2c7f3aacd31b564beca3a3d93a98f4efded6af58'/>
<id>urn:sha1:2c7f3aacd31b564beca3a3d93a98f4efded6af58</id>
<content type='text'>
"enum" keyword will be introduced in PHP 8.1.
https://wiki.php.net/rfc/enumerations

Signed-off-by: USAMI Kenta &lt;tadsan@zonu.me&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
