🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #4124

Re: [PATCH v5 0/3] commit: allow -m/-F/-c/-C for all --fixup variants

#4124
From: Phillip Wood
Date: Mon, 30 Nov 2026 14:29
88 lines
14805 bytes
Hi Erik

On 28/11/2026 12:13, Erik Cervin-Edin wrote:
> Changes since v4:
> 
>    * 3/3: plain --fixup -c now opens the editor, as -c does everywhere
>      else.  v4 kept plain --fixup's existing no-editor behavior, which
>      meant -c silently acted like -C.

This looks as I expected, I don't have anything to add to Junio's comments.

Thanks for working on it

Phillip

> Background
> ----------
> 
> Today only -m works with plain --fixup, and neither -m nor -F works
> with --fixup=amend: or --fixup=reword:, which makes those modes
> awkward to drive non-interactively.
> 
>    * 1/3 is a preparatory refactor that writes the --fixup subject before
>      choosing the message source, like --squash does.
> 
>    * 2/3 lets -m and -F supply the message for all --fixup variants.
> 
>    * 3/3 does the same for -c/-C, so that all four message sources behave
>      consistently across the plain, amend, and reword forms.
> 
> As in v3 and v4, -c/-C go through prepare_amend_commit(), so if
> the source commit is itself an "amend!" commit, its subject line is
> dropped and only the body is copied.  This is what a no-source
> --fixup=amend:<commit> already does.  The helper only knows about
> "amend!" and not "fixup!" or "squash!"; that is pre-existing and I have
> left it alone here.
> 
> The earlier rounds are described in the v2 [1], v3 [2] and v4 [3]
> cover letters.
> 
> [1] https://lore.kernel.org/git/cover.1779792311.git.erik@cervined.in/
> [2] https://lore.kernel.org/git/cover.1790082176.git.erik@cervined.in/
> [3] https://lore.kernel.org/git/cover.1795562078.git.erik@cervined.in/
> 
> Erik Cervin-Edin (3):
>    commit: write the --fixup subject the way --squash does
>    commit: allow -m/-F for all --fixup variants
>    commit: allow -c/-C for all --fixup variants
> 
>   Documentation/git-commit.adoc             |  22 +++--
>   builtin/commit.c                          |  64 ++++++------
>   t/t7500-commit-template-squash-signoff.sh | 114 +++++++++++++++++++---
>   3 files changed, 140 insertions(+), 60 deletions(-)
> 
> Range-diff against v4:
> 1:  ebae1fbe05 = 1:  ebae1fbe05 commit: write the --fixup subject the way --squash does
> 2:  051b659965 = 2:  051b659965 commit: allow -m/-F for all --fixup variants
> 3:  159a56c510 ! 3:  9ab3665cfc commit: allow -c/-C for all --fixup variants
>      @@ Commit message
>           autosquash.  This also means that "git commit --fixup=amend:X -C X"
>           produces the same message as "GIT_EDITOR=: git commit --fixup=amend:X".
>       
>      -    Plain --fixup never opens an editor, so -c there behaves like -C.
>      +    Plain --fixup turns the editor off.  Keep it on when using -c, so that
>      +    -c isn't silently treated like -C.
>       
>           The incompatibility check grouping -C, -c, and --fixup can go away
>           entirely, as -C and -c are already rejected together by the check that
>      @@ builtin/commit.c: static int parse_and_validate_options(int argc, const char *ar
>        	die_for_incompatible_opt4(have_option_m, "-m",
>        				  !!edit_message, "-c",
>        				  !!use_message, "-C",
>      +@@ builtin/commit.c: static int parse_and_validate_options(int argc, const char *argv[],
>      + 		} else {
>      + 			fixup_commit = fixup_message;
>      + 			fixup_prefix = "fixup";
>      +-			use_editor = 0;
>      ++			if (!edit_message)
>      ++				use_editor = 0;
>      + 		}
>      + 	}
>      +
>       
>        ## t/t7500-commit-template-squash-signoff.sh ##
>       @@ t/t7500-commit-template-squash-signoff.sh: test_expect_success 'commit --fixup works with -F' '
> 
> base-commit: f7de81456940dd6f3274e461149bba12965de609
Technical Details
Message-ID: <ed89fa81-3974-4898-92b9-186fe8051585@gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76682-linux-kernel-git=dewy.ru
References: <cover.1795562078.git.erik@cervined.in> <cover.1795867565.git.erik@cervined.in>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76682-linux-kernel-git=dewy.ru
From: phillip.wood123@gmail.com (Phillip Wood)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v5 0/3] commit: allow -m/-F/-c/-C for all --fixup variants
Date: Mon, 30 Nov 2026 14:29:39 +0000
Organization: Usenet Network
Message-ID: <ed89fa81-3974-4898-92b9-186fe8051585@gmail.com>
References: <cover.1795562078.git.erik@cervined.in>
 <cover.1795867565.git.erik@cervined.in>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1444821"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:yYbOO6Tb/PUcAZlZnFmWA7Bc7KE= sha256:FaTboywMJPSmZ2sAH2FhPru0WaVeUSKhCdwvoZ4bio4=
	sha1:FFbIm9oiujrUGn1xSeHRY0Gf0q4= sha256:eT9j/lK97Ztm+9COn4vojgVQ0fVtIjaDJKlr1zVRTqc=
Content-Language: en-US
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 67F61125FEE; Mon, 30 Nov 2026 17:30:02 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.049
X-Spam-Status: No, score=-2.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FORGED_GMAIL_RCVD=1,
	FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham 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 rvdFyiGF1TbC;
	Mon, 30 Nov 2026 17:29:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76682-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 4CD5F125FED; Mon, 30 Nov 2026 17:29:50 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 235582C8F6; Mon, 30 Nov 2026 14:29:48 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796048987;
	b=l2nkOHN2NjcWAzZSEQehKvSm2W3JEnndnqTqnJzci650Qsdgi0RK+PAwSPayUijYkaHI
	 CslaYDBbOeGAgZtzpvvSIPfq0uyWhzcGPcC4E/mvFVLVBw6Tkt5OvLD/Hmr1xRE4JURSD
	 uRn7t1zk5FhNvPe640glh2iB8E4AtI5XpHn6z1owjhtOJTcD2XUXRI98GJGEqH2P2N+OK
	 ZGC5qyGylZmUVYfdbKuFvbnUSzVp6jpdrX8mV8QePZ4sC2NNFaWCg/qzYSBh4ODEJIBxm
	 o/qgWVbnpCSvsXsDkTSO9iCnqJo5pQ73NrjQGmRfxgq/ITM+ZSOKRtpxOVC3obEkpQw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796048987;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:Message-ID:Date:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:User-Agent:From:Reply-To:Subject:To:Cc:
	 References:Content-Language:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=46/IM6GDg6CMuIbQCx5NbFqxYVICXctdAhYhL7s6MDc=;
	b=5Kx1X15l4//QfW4kwTPgoDDw+SjxeEa0GDI5BbWKssv31WU0+4uxXa0gl37ZNv3H7jLF
	 VYLemhrer/Lh2F9HYn/9keuxIHKu8eqx13HkLYfctdyWXVSWShlDTxNNrMi4H6owV5OrS
	 5+L6v0yZ42WzJQDm/a9bKrPPkgOnGOAxeOnuqIYDWg+V7wTgBXOQ3pO430ryEUctk2wz2
	 vVg+/ZwzXY02479Nh4RotURUpb3Bhmi8bQuH4pv9DTPTRqm8JrZRedtwOzfOX4xVtNJhP
	 VjDbYP7f34bWY5ZF53ORS/mW6VwlTOnpyhMHEvegSVcetpJ/QQWf8dwv3n6iuAIEupw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=UrB8BCgM;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D1B06606A32E;
	Mon, 30 Nov 2026 14:29:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=UrB8BCgM
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.43
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796048987;
	b=T9xGZoe822rR/haHmJRFpwE9mz6b1BLZimNa02RtWSRmVqfctt/cr81AMW8/8N0t/sMl
	 +cRKL6QTx9CbD7CE+py/99MBn/mct4ZRYKW2J9LnKx7fPTqupxoMkM+OmUP90yF04Y1Q/
	 3DLTBV/9GPQqkP7qyBEJj1xaErFcqZOspud9Xa8e4divMrkwZJon79UQadiT2JtbSaHyx
	 LJC4oD3I9BhUzNTPyfIeDmCeKmNg/L8SrAuy+Kg9HyrOZgedDth5y5rlzIcm31IN+//AF
	 Fa7EmDXCKJw9yMjhowymVe6AGCIKmVD39xkk6s8yzpvxdRt38k8JLTbRQP0P/tVs98g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796048987;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 Message-ID:Date:MIME-Version:User-Agent:From:Reply-To:Subject:To:Cc:
	 References:Content-Language:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=46/IM6GDg6CMuIbQCx5NbFqxYVICXctdAhYhL7s6MDc=;
	b=Wwu+mZk4HsICJkksyL3ktA2f2kTqWv2K4TTl+Gpjx0YlXZqH8Fx024W0DD3kKGbG4xj/
	 ijzpLWlOgGGLbfxUPskcWkhcQ3xQyjG4MUlUbP3vda3ImyTT5ZPIr35Y1c+87ul63kkJq
	 y9ruoKuhWHKP6AqaKWzzHY7d0nhC/xB8N2j8aE0UedI5LLoUdbmnCr+hdcfKiH81sH4Qf
	 dP4/9oRnK92sQLUglSQHS4UBePK87r7ZKujtznCT0RW3SgZ2YES/rVshKWnmeUDfqsnWP
	 ap1CZlH//UXyrsw9c6T1SaImkZiIa68Z6Ca6Uk10gY33+Kn/5VO2G2qN387Py76JjNA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=UrB8BCgM;
	arc=none smtp.remote-ip=209.85.221.43
X-Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F2DB606A327
	for <git@vger.kernel.org>; Mon, 30 Nov 2026 14:29:46 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9F2DB606A327
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-wr1-f43.google.com with SMTP id ffacd0b85a97d-4a7b8abe209so8200650f8f.0
        for <git@vger.kernel.org>; Mon, 30 Nov 2026 06:29:46 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796048985; x=1796653785; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:in-reply-to:content-language
         :references:cc:to:subject:reply-to:from:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=46/IM6GDg6CMuIbQCx5NbFqxYVICXctdAhYhL7s6MDc=;
        b=UrB8BCgMIpiFSJsrchDAmRuD0EsW3+34Ukz8q7wC3pKvuP6YFb4rGmPoExuiBarO4t
         IyseBXaKX2W1AjX3OSphAUjv36kBpPMF+wU3p6HlMO0QmrjR2v0CXzYVg4kdpeaJPYWg
         ZZUKDATWaFhjpW1Tl8X3okz8Ir5Lm26WJvyPE+OP40tvxFFbbboV8eIQjjjrWvNT3oCU
         LrkQvoIH2/ThcVHS/7ecRWeD1ZGNp616XIyCLGoMLRKdVIESFd6ukTHkDb8UfKZgmGUx
         A9+XPijgSOeHuGM5e7M0amZ8il//y867Zf1eof4G0EZ3q7GchybJZjkAOJG/1WKnrhfo
         YJ7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796048985; x=1796653785;
        h=content-transfer-encoding:content-type:in-reply-to:content-language
         :references:cc:to:subject:reply-to:from:user-agent:mime-version:date
         :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=46/IM6GDg6CMuIbQCx5NbFqxYVICXctdAhYhL7s6MDc=;
        b=RKKzaZV2YVEkOrS4bNidQFkktwLV6zz3VstQNxONOA8yP0BMGG2Bmd01Y1GIQIQU4J
         OOq3RGXc9I/522PAm40WM+DE9OOoqZTglmjN7YH5GlVc4Xwz/xHpL1HrBabn89c1bPxp
         cwHH6klZJDTRwl8rE/QtHW0TQykIlZC3C3fwQYOOvD1M0Jc9yTbKmlyOhNwVbSwZ9lrF
         RF0ZB/Hbh04stJtwvOR1ovVaSTcDDSw3PDkqpzl0VYtHuod7Dx6b2nndwrApuK5uyLGu
         NGAu6y+1BQK0AW8MHYGZ5f5DK3gx5ZjvGfuIDMFDKljhO6QwQaIfymDY5T9tsH9YjYPT
         aNkw==
X-Forwarded-Encrypted: i=1; AL+hErHlAdBjrFwOeE6vd9U+Zzn1GgpzZgdFvltWmLlrNz+UOyEU1MxICD+NTo39npze/EFJV+g=@vger.kernel.org
X-Gm-Message-State: APuU4Z9vLYGceQBEgHCF6HMeoGXbFQccjZVQ9yfuVdrrw293NBvihnxL
	MM9vBnH1tEBftv2OCpJEqtOmlpGZux3p1UueYN5r9KKVQCGIXdgIU/sT3KZq1A==
X-Gm-Gg: AZFdTZeJGj8EAhfIgZONIZk1eXvnRC2Z+ZgIEXI4HEMS6FS8XAxcNC/dx8+duOq9xX+
	/x+9O/EoWqLLkVDWV53IyBD+oN6FTj2Jn28Q4ihUn6UsnYfrXR+RuoJAYR341ODNnDgUnYxcwi1
	tKPVBTyXcnfQCp+L/ZVOiJfuAa3hG3NKB3tX5WOd9nkdoDZSBpUihj/xnU2+BekrcHOxLsZYYNG
	sWriTwCFZtUhLE87/wqHB1MKLR+VYCcC9eD8uVkYWoWFJVMUSGGh7mcVslE2tCILbGmOmVNH2wT
	64XsvpUkkHNN/gGJJn2L0mXOTL547kRHHeZQYY9xK7yOXodiY1oBG5ad71guLK61q6MHs7Rg+oh
	Zdq/PllVKgJHozec2kmPbxnBbtqENMNatwAdw5IkTfUbbUSs/N2ON7XMwoO4ic5nx7dVs3zhZre
	hzZfK2mRIhZkGkv0v6oTaUUTkHSEGVbpze7Jg8f5Phf7Xepz1Zv05DhPnTvTjla+/lqu8MxIWCW
	unkJpVlgq/epoYxy//Jd5W0ukbNtIA6O9YxtrCyQuzKF+l8dBOM5Z5UnNxfBCNpqrOOTTdFtlZy
	VdqFOdwj1t8ALlDSIX23bygDNVuZtWEOSmKbJ+c3Tc/nRlWZi1O3Nc/QaYAHtLelwU8//oHDRe7
	Ji6lkQWk=
X-Received: by 2002:a5d:64ef:0:b0:4a5:af7a:b7ad with SMTP id ffacd0b85a97d-4aba4d612fcmr67472738f8f.0.1796048984834;
        Mon, 30 Nov 2026 06:29:44 -0800 (PST)
X-Received: from ?IPV6:2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f? ([2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6ae2dd55sm63574569f8f.30.2026.11.30.06.29.44
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Mon, 30 Nov 2026 06:29:44 -0800 (PST)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Reply-To: phillip.wood@dunelm.org.uk
X-Cc: gitster@pobox.com
X-In-Reply-To: <cover.1795867565.git.erik@cervined.in>