πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #629

Re: [PATCH] pretty: fix lost indent after newline in %w()

#629
From: Andy Koppe
Date: Thu, 15 Oct 2026 20:11
29 lines
9565 bytes
Andy Koppe wrote:
> After a hard line break, 'space' already points to the first character
> of the next line. If that character is whitespace, it was wrongly
> skipped, so the line lost one column of indentation. For example,
>
>   git log --format="%w(11) This is%n  the %s%n  commit."
>
> printed " the ..." and " commit." rather than "  the ..." and
> "  commit.".

Admittedly, that's a bit of a silly example and test, just to keep it
small. My actual use case is "%w(72)%B", because I often have to deal
with repos that don't stick to line length standards, which can make a
visual mess with --graph or with wide terminal windows.

As a better example, lists of files and their changes like this ...

- foo.c
  Frobble.
- bar.c
  Bobble.

... lose a space of indentation, thus breaking alignment:

- foo.c
 Frobble.
- bar.c
 Bobble.
Technical Details
Message-ID: <CAHWeT-ZuZ8ScKpdiV94UjvGNJmsv8vwy41Hm8OSCSETciFRh8g@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72179-linux-kernel-git=dewy.ru
References: <20261014172333.2224123-1-andy.koppe@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72179-linux-kernel-git=dewy.ru
From: andy.koppe@gmail.com (Andy Koppe)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] pretty: fix lost indent after newline in %w()
Date: Thu, 15 Oct 2026 21:11:24 +0100
Organization: Usenet Network
Message-ID: <CAHWeT-ZuZ8ScKpdiV94UjvGNJmsv8vwy41Hm8OSCSETciFRh8g@mail.gmail.com>
References: <20261014172333.2224123-1-andy.koppe@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: usenet.network;
	logging-data="2613078"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:gR9nDST9jSG8Kr/Ulp8QO+zpAHg= sha256:ufvqTWBdAFXpq2q6TRKNqZ5w4fnDtsFj4lm/Lg3SHRM=
	sha1:/W4HjtknxY02Gf2EgeJb7eMjhSI= sha256:TJSyQi8BtY/2avQvJYJHn+wajm6LxEV8/MqZ1G30Jog=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 2B1091103CC; Thu, 15 Oct 2026 23:17:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 0.352
X-Spam-Status: No, score=0.352 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=no autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id g1BnDI34YdMX;
	Thu, 15 Oct 2026 23:17:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-72179-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id CBE461103A5; Thu, 15 Oct 2026 23:17:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 2B87860B5D; Thu, 15 Oct 2026 20:12:31 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E7384A5EAB;
	Thu, 15 Oct 2026 20:11:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B0NISw6M"
X-Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC49B4A4995
	for <git@vger.kernel.org>; Thu, 15 Oct 2026 20:11:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.160.46
X-ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792095100; cv=pass; b=QNa2OswBsOzy6o2ajwY4F+Mg7xuIIexaQDPsJIy/FyZa0m6RCXnyQRnfZLhp/DJpTvkJRZHTqE6/plZMWTWCz33VFMNB0Nc7zy+lq2sRq+eONOCzIcMXHTA5EAwJUIiDmU5dpH7PczDvDoj3P+y43eko/S7/Lo8/Ks0/kYp5tfg=
X-ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792095100; c=relaxed/simple;
	bh=zK6l61rOvO4vu/QlHWgux7CqD0RMcAm1Oh7Ja9DHfQI=;
	h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
	 To:Cc:Content-Type; b=o0Xo/CnC+7uQxc9LB4M/nrEv7uNIVIJDkRtg6XKvvRzGlSOK8wmhg5BPRr5tQ74va/eNDrS9Mm6wwJOybIuROcjL8RqpX54Fu8EeRQLCjLZdodAqtybaqO9sRzjJc5h6UkOHO8SrkwvwxkVeCzhfocGpvClTty3hIqf3zJeJcBY=
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B0NISw6M; arc=pass smtp.client-ip=209.85.160.46
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-451a49abd8aso1809155fac.3
        for <git@vger.kernel.org>; Thu, 15 Oct 2026 13:11:38 -0700 (PDT)
X-ARC-Seal: i=1; a=rsa-sha256; t=1792095097; cv=none;
        d=google.com; s=arc-20260327;
        b=c9DZuzn+chgg2dx+EKu0n/xv2hUKt79HFCNM7VizC9trNO8EF9X8zXKR0T5PhYPNKh
         INUATRenXpgXMgHORZq4JSri9kI54ST3lQCuIm8LXPUHfnlWWr7Xf25Xb2nMyhgWmDa8
         vb00qdkg39do6odEiWczatkF8qxWbunW141EfB5I+SeJCttmcu5hS6IqkkCDvZxzp2J0
         2QfdlJoKjco5FcDxaoGFI+zFqgKCz+Fv8CAIHUU/DLBTlhNaC5TAbybtr4+slPS/6H8d
         P6dvHnKBzHGmbE/JHB5niN/fBN8YIBU0pQFjMSpECOUFImZl8PF1pYkrqoAWJtnTUzZU
         EXnA==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=FQGbu2Me2oNxjDNNGX96xSy45bVD9NN3XbIXrGoG3/E=;
        fh=2PECsuwM2P+0HCuPJZggfx7emUJu8zadisJj0up3YuU=;
        b=DS8hvrLX5pVznNbrt83cR9sscDjxs+5x2T07Zy09nLXoXkEJUKyPV0fcwy1RkaIxIj
         /tcRe0qYU7CKcu/C+H3be5+lOUkF3r2D0fuvk8EVopQgr9u/CnF7lshS1FfmMzVQWyui
         C8t/bWyvk9QrIz4VoMieKlsoNxJSnCeSH8wdLT5Zpt+Mz6txyV5k71ObX3+xBvQfCord
         DYoDi/zcUElNdm5FVLjEY0gXkseQzD3VHrTXvpwAQE5KEsBygVANb2Zy3uRaKE98H1NC
         bGyAWz48YpfGwQNevsiV0yQwLL+7rMtGH8Wgp8GOwSfMiu8wAl21iTZKn5vrpKpxK95c
         wKCQ==;
        darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792095097; x=1792699897; darn=vger.kernel.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=FQGbu2Me2oNxjDNNGX96xSy45bVD9NN3XbIXrGoG3/E=;
        b=B0NISw6MafMUy9NQDWRemHUAT05M74SGSg2y+d6/1XuYZbVct/RGf1y0CC+dx8mSk0
         4vfTJsftoPRZRgU82HPHlV5A1ZNrUgooeduEfu4OS8zizlBVx50+U8XR+zJNRL347UVk
         B7/VWVUCsrTOqKu1hkm2aNXN9xsN3SmuW2Iwlcl2WbcJjFGiU4cUZWuKpfvSwIwIoRrP
         bmJtLuzMdUHpQPzs9zdZctyOKS72gINMwNFRqIf5EnU3poRSV6+tXBrxYIEwO9KGaGqC
         twZlL5nT7sAK44qlUFySdUAsX8Sp47whethvFgRV4QajTDkuTr/PjLL7EATY0on1KHlO
         toog==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792095097; x=1792699897;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=FQGbu2Me2oNxjDNNGX96xSy45bVD9NN3XbIXrGoG3/E=;
        b=s838dzmtEgNcENGzcjqInyLPOxxSMyZU3BgEXO6v6esMMhavW8XMHsJVTJW/RTxXzd
         B9jtmKxA2TtaQfuPB2usi8TUa/lQOibqgrJeOpNK3QqBr/fOXwI++OFdr2pbQ3FZzGKv
         kFigxRZbcfMETjYPgVQ5Fcb5pGrMIFxpNfNCnY7txVix616TMI7Zc74GnWpK6Pe04djA
         zvVs5HTRc1ObsLol5ax1yRgYE6ghB3QJH4Rmr7FY0gbSp2CMVRhVrhH+JbyUszuk95vo
         MIrDhAn8jMKMy5m1yQ1TiXppSl+GiGcZR5v+0wvlxMtvdcd4teuDcYmsMJQFXRQX5XrG
         NLvQ==
X-Gm-Message-State: AFq9FYL+EdLhrE62H72fe6TArzotqEsaxrTdXWK3RZ8+3x4gnCWTnnJl
	kThggnF2BdO0iAOgHkENVkWzPBRG55ca5ewZrxuTufQq/w+ZwkxkEPxS+ctYhSg9FvXNUOmVMxg
	mkzloduLItnJdGmPVuIc+kr1PhtSw/WglEbGxa1w=
X-Gm-Gg: AYBFou2/4H4fJETaC+Mn5MwpqqA+IRhumBmvwnxN0A9ka2oDFOZzR5At0auP3KS7dxL
	ej4VUgYE5u+vaxSc0CwCNOwW4OAXsHfPb16S9m6VshJPPuoNEwu/duxTqEHv9tNUljhk1U8ktM+
	419jf1uUCnkTbVt768O9UBIq92TAFcA30ClWq4ebGzYim2/47zjOSldomM5EOz8EUe6LjMu7OmY
	GXAngsYHeDSm5tHd5/3kxVT2F3UmHDc7kB4fnjEqUrFfFwjjBwHuUWvFMQdgQNsQmlPUjJNGbWO
	bkKzP3pJrhkaOsuLRw9arwgbT9zGQDnc8nlQ05D5hyTrJiTiOwy/RQ==
X-Received: by 2002:a05:6870:b009:b0:48f:e0e5:a1ff with SMTP id
 586e51a60fabf-4a2a8b30b3amr16124428fac.51.1792095097367; Thu, 15 Oct 2026
 13:11:37 -0700 (PDT)
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-In-Reply-To: <20261014172333.2224123-1-andy.koppe@gmail.com>
X-Gm-Features: AclHuK-gO0hjOulnVWY_DVtHtAziVKsiyR3wzVsS6lduSmr5xFy23mRMfPDcKz4
X-Cc: RenΓ© Scharfe <l.s.r@web.de>, 
	Johannes Schindelin <Johannes.Schindelin@gmx.de>