From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 600B8470452 for ; Tue, 21 Jul 2026 19:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784662412; cv=none; b=ep2OgdnUpnu4SEtLqUxcefUI9tIBzH3weUtoCTR9gqYo6WEbpnimK/upP1jd9E+1J5GVlxrpnCgTU5hsBkySZkJh6IO/SIYubNQiKqmAWA6G47noNNhpMiSUdmktmRt3KH9vJf03Kd7YVTaAAJjFgcCWleJNI1rOk0XBVl2FGCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784662412; c=relaxed/simple; bh=1r7qC223Mjnm5i/u9NFWfsno9+ukyxMZg4Vsaqgi4s0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=hWhvOyRx+jJC/0mK1Knd6Vnjk4SHy1sxCXQ434fTtjTxL+IVsEYfJZaF5KaOEL9iMZ9PJIR1PxB0z3yBlJixF0C+Rn6ByV7dv69Z7fKJNEXbdgfjEF5O+DwvymTE2BfflViB8ihlbjWU9/i0Z0Ll7nGYDryXP6Zue8kkfq7lw8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=dRypqU+C; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=alf365i8; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="dRypqU+C"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="alf365i8" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 8F7F87A00E2; Tue, 21 Jul 2026 15:33:30 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-05.internal (MEProxy); Tue, 21 Jul 2026 15:33:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1784662410; x=1784748810; bh=W0bAQMZx/4 CsTTYDpD3INQq2lzN3qTGRVgLd3nu1Zsw=; b=dRypqU+C8oUq68l3VsNKtEVBK+ NHZU8wIyTI81TBZu0jccUzZI6qjQ3F0aCrMXeIuT5k8i9xyKcG6cJ2u/Kjj5DgtA Zh38babs6bO+F9hjqo9FqJcRer66hOga20d/ahrfQGC66N+gK/RkFdDALagq6bPY 0BdO4Q+4FKi6vGrCy9hC0kX7mDRJdptL8uwByMnKIiKl2YzOru9/GRHXQNeKegfj /pVcroYuDfJBmYoFx/8X5EXYyajAmNIMJpM7inq98T7ywPchLou8/nXyKBjJc+Mz 9T7kvyFWEU9kc0ilIXn/i9my4aAILCQVM7uQwc8qrVNi8RYxmyz50bSudOIw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1784662410; x=1784748810; bh=W0bAQMZx/4CsTTYDp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kD5CUf/fQ X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 21 Jul 2026 15:33:29 -0400 (EDT) From: Junio C Hamano To: Shlok Kulshreshtha Cc: git@vger.kernel.org, Johannes Sixt , "D . Ben Knoble" , =?utf-8?Q?Ren=C3=A9?= Scharfe , Eric Sunshine , "Scott L . Burson" Subject: Re: [PATCH v2] userdiff: add support for Swift In-Reply-To: <20260721065736.8747-1-diy2903@gmail.com> (Shlok Kulshreshtha's message of "Tue, 21 Jul 2026 12:27:36 +0530") References: <20260717140232.6722-1-diy2903@gmail.com> <20260721065736.8747-1-diy2903@gmail.com> Date: Tue, 21 Jul 2026 12:33:28 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Shlok Kulshreshtha 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 > --- > 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'.