Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Shlok Kulshreshtha <diy2903@gmail.com>
Cc: git@vger.kernel.org, "Johannes Sixt" <j6t@kdbg.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: Tue, 21 Jul 2026 12:33:28 -0700	[thread overview]
Message-ID: <xmqqmrvkw31z.fsf@gitster.g> (raw)
In-Reply-To: <20260721065736.8747-1-diy2903@gmail.com> (Shlok Kulshreshtha's message of "Tue, 21 Jul 2026 12:27:36 +0530")

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'.

      reply	other threads:[~2026-07-21 19:33 UTC|newest]

Thread overview: 8+ 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 [this message]

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=xmqqmrvkw31z.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Scott@sympoiesis.com \
    --cc=ben.knoble@gmail.com \
    --cc=diy2903@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --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