From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.43 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== 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== 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 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 ; Mon, 30 Nov 2026 14:29:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9F2DB606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com 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 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-4a7b8abe209so8200650f8f.0 for ; Mon, 30 Nov 2026 06:29:46 -0800 (PST) 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) 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) Message-ID: Date: Mon, 30 Nov 2026 14:29:39 +0000 X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Phillip Wood Reply-To: phillip.wood@dunelm.org.uk Subject: Re: [PATCH v5 0/3] commit: allow -m/-F/-c/-C for all --fixup variants To: Erik Cervin-Edin , git@vger.kernel.org Cc: gitster@pobox.com References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: 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