From: Johannes Sixt <j6t@kdbg.org>
To: Junio C Hamano <gitster@pobox.com>,
Shlok Kulshreshtha <diy2903@gmail.com>
Cc: git@vger.kernel.org, "D . Ben Knoble" <ben.knoble@gmail.com>,
"René Scharfe" <l.s.r@web.de>,
"Eric Sunshine" <sunshine@sunshineco.com>,
"Scott L . Burson" <Scott@sympoiesis.com>
Subject: Re: [PATCH v2] userdiff: add support for Swift
Date: Thu, 23 Jul 2026 10:00:27 +0200 [thread overview]
Message-ID: <d3337806-f044-4571-90f2-aaebb2e295ce@kdbg.org> (raw)
In-Reply-To: <xmqqmrvkw31z.fsf@gitster.g>
Am 21.07.26 um 21:33 schrieb Junio C Hamano:
> Shlok Kulshreshtha <diy2903@gmail.com> writes:
>
>> Add a built-in userdiff driver for the Swift programming language so that
>> diff hunk headers and word diffs work out of the box for ".swift" files.
>>
>> The funcname pattern is built for Swift's own declaration grammar: an
>> optional run of attributes ("@objc", "@available(iOS 13, *)", ...),
>> followed by an optional run of lowercase modifiers ("public", "static",
>> "final", ...), followed by a declaration keyword (func, class, struct,
>> enum, protocol, extension, actor, init, deinit, subscript). The keyword
>> is followed by a boundary that allows whitespace, "(" (init/subscript),
>> "?" or "!" (failable init), or "<" (generics), while still acting as a
>> word boundary so e.g. "initialize(" does not match.
>>
>> The word regex recognizes Swift identifiers, hexadecimal, octal, binary,
>> integer and floating-point literals, and the language's operators.
>>
>> Signed-off-by: Shlok Kulshreshtha <diy2903@gmail.com>
>> ---
>> v2, addressing Johannes Sixt's review of v1
>> (<2a3a73c5-5e90-44a3-bf6a-6e98ce5e5a59@kdbg.org>). Changes since v1:
>>
>> - t4018/swift-{init,failable-init,generic-subscript}: "RIGHT" now
>> appears only once, on the declaration line, so the expected header is
>> unambiguous.
>> - word regex: dropped the redundant "?" after the single-character
>> operator class. Single characters are already covered by the
>> "|[^[:space:]]" fallback that the PATTERNS macro appends, so only the
>> two-character forms need to be spelled out.
>>
>> (A couple of Hannes's other suggestions I kept as-is; I have explained
>> the reasoning in a reply to his review.)
>
> Thanks for an update.
>
> Let's wait for a few days to see if we hear more comments and
> otherwise mark the topic for 'next'.
This round looks good to me.
Acked-by: Johannes Sixt <j6t@kdbg.org>
-- Hannes
next prev parent reply other threads:[~2026-07-23 8:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 14:02 [PATCH] userdiff: add support for Swift Shlok Kulshreshtha
2026-07-17 16:27 ` Junio C Hamano
2026-07-18 18:11 ` Johannes Sixt
2026-07-20 4:55 ` Junio C Hamano
2026-07-20 8:49 ` Johannes Sixt
2026-07-20 9:52 ` Shlok Kulshreshtha
2026-07-21 6:57 ` [PATCH v2] " Shlok Kulshreshtha
2026-07-21 19:33 ` Junio C Hamano
2026-07-23 8:00 ` Johannes Sixt [this message]
2026-07-27 5:03 ` Michael Montalbo
2026-07-27 6:44 ` Johannes Sixt
2026-07-27 17:37 ` Michael Montalbo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d3337806-f044-4571-90f2-aaebb2e295ce@kdbg.org \
--to=j6t@kdbg.org \
--cc=Scott@sympoiesis.com \
--cc=ben.knoble@gmail.com \
--cc=diy2903@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox