From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796475519; b=O49xjTAGY8fWEwRVL/oHEABktKSZ/w7JwnQA5O19n/CiRCzrwW2KRvf18kKxmALU6l4h P59m+AcPMWmK/yl8S24UThceBkQ4d68TH81SqRGYvNtgKfVSwLwT5YSWcq4PiEgOunYnP vmcuy7woBc6+jNdunqU/cYvGujKnxGb2wI1TN9ikqCLZQvpW+z6TD/Bx7NOu0OlV8Xqse 9LfiBLT22yJV3I1vvHsaf7nR0D516QLYLHu9e7I5b2jbEIrbcSF4nvEHGjVtznbUjpb8/ hu53n2/zRPVGng0MWwk84uZ4PxhzVzSJ5p+ueH1W9L0azHaFfrlzZFKi32rO7xirOKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796475519; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Sender:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=6Gpr17j25DlSkbM45w30OwdI4Nq84Xn4JLZ5kZiV+SE=; b=b5dG8QfTLabZdzKPX6EpVg6WTUOIs/80WKvD7L2WSQwggzdnAt1SFht2C0Wu3H7Xntnj O+5ubzpjjDJkmdMadznGPZwxXJQ7LPLqM6V+4xHHDu/lJgWY5CURDQy8gB5NyTPZOVYvM VJi9EOvCJJVri3/xq67JIg6f0HQsH7i9WPOEaH8NFLgplLaBuXbFJjR4CGmgfNl1eS2TZ Q/gQfW9gu9rBNb3cMviR7Xtzzmwwo9R7tJRYKkpxUPU1mb8cTXZsKm298NDuXtx7o7227 G2Y3SIejtX4fzU4uSMS2c/WXucp11VqtJLxDGsAiWaO2qYnniISXoaW8dikv7V3Piuw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=cervined.in; 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="LZQEgi3/"; arc=none smtp.remote-ip=209.85.167.50 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 D963A606A322 for ; Sat, 5 Dec 2026 12:58:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D963A606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cervined.in 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=LZQEgi3/ Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5c158c4c15fso1927690e87.1 for ; Sat, 05 Dec 2026 04:58:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796475517; x=1797080317; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to:content-type; bh=6Gpr17j25DlSkbM45w30OwdI4Nq84Xn4JLZ5kZiV+SE=; b=LZQEgi3/hCGCbzpLHbpjxQ1BVI0m5D/b9DkfZzc96zfaGFdGx87e884fznGBiTuj0+ iAjbeoHGtWTaVuQbwcljlU8grUDLRIh69AQXLPp2P70qdyUWYtt6lBX+lT6dhtsCxqdQ arcmvi/3thTi78HFgstnzirhWP9srD0zGs71grR834k/A279I+2m54nzh+uUVs0Ii3ZW LUgRJj+xzgPhht/xJwFYjPIbjWWa+/a0mBjtJ/crttwNhSM+Ip5sU8y3pfNUxhQvG3Iy Hm9kmV/65M0UdOjUNXgmE8cYSxkP3CwbPzxIzmVTjhn8sQkfbkc9JZIxkaeaqH1NFeuE F+oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796475517; x=1797080317; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6Gpr17j25DlSkbM45w30OwdI4Nq84Xn4JLZ5kZiV+SE=; b=oJjViCkeqkAWcP7WJKiBM0jCG/YDezBvpr/MChCTAV1m1XAw+FMWhlZIXPileLZiRq SLwmBvmd9OIhZ2RHqseSFt56xZtoCN4jeQ+wAzpUDn3UagGaAWg0su9xHuzmwwCb/jL9 5d0bh8y+d4B7slYzJ7yL+2oaeb35HVa66Oa+c5D9HFewau3NNGXcDyBi8CQsgfBkeC9l G4/Dq638/nOZIjvmWuioZitIq8jF5DP9usFPIjZxWUkvUql1qsSHoCFqWgRXBlyd852m an8TmPNVpmwXz+glNUSwsB1BAROHMZBkDmyQI4hnQFq6weBBRiSLElftKq0Bwtyx96u4 Suog== X-Forwarded-Encrypted: i=1; AL+hErHqw+ipOsiMxWaVcLT64fF/XFSMKd6w5MKEAdA8bO/hpDvj4wj0b7OEUn8xfHSonO1KRO4=@vger.kernel.org X-Gm-Message-State: AB4q+uHB6JBCHZhBnlBxdK8GW0skhv241p/Fm6WnnqhGRHUBnZc51Cu3 kg+RpxNtLVuW7GEtqmB0KXZZw7hkE0CDJIKuNNho5UKcpHd8qPWNCLCiTxMmSw== X-Gm-Gg: AZFdTZfHkBwxhCm0/x7JYCd8TY7y2WXS2yHKIkdOaze0BointbZajOBJzYiZPpfeUfr U63BlEpCRYT+AO8PM+DElr5HO/mcTCepYTapYmqmmlIrBSvO+2OiJF8k11CqERekc3VoLedwNYQ l1IhSbYBKUuBZgH3FLmjBJCs5JKSJJOVboC3XpmcuHRJTQDFkXyLIUXMDnYYLwtehyUBa4myXLb YDJFlggYoH40FfIgO8cUCI1gcfzowA+PAkKErjV01UT5LNob2dHZjqXeQdH66sPswNrBqFx30sL CrQGpH0Ds2eOXIxIL0LX4NyNOiGNidLPDiBVMKwvOliwCg4NtysId6n3XWZatuHhCE5hw34xQoQ ekWWbTe4YdzJXf+wfZnZ3dBbivsVue8rwP/cFSZcDgz8F2GaEBszVzgpoXEn/nQy3i3xwg5QTFN pqbEKhtryfkCMKeC25I41g9dhkEJX/yuKsKAHVFfRNoi7PiJxEfi64m1o0smFtbbZs7Ytxhs5Fb ScgEw/KmemB+ZMEgyuZNmcEBIrUlz/lVODtAhELvZZgwCi5yhY/kZkMdxzc0mlTwoxYrIwhk7rm 5Ho54WjKHU+kI2ZjenY8K1qiQOf7mWCs/cPTHiZCEyXCBC4+2XqAh8ibz+Nrgeevi1K3LxqSUWW A+b6GuVoLeQ+32zkC16y58OlhFIg2Jk3pw/PJRAUPTb3O X-Received: by 2002:a05:6512:2308:b0:5c1:5715:dbb9 with SMTP id 2adb3069b0e04-5c3861ae790mr1024197e87.15.1796475516688; Sat, 05 Dec 2026 04:58:36 -0800 (PST) Received: from localhost ([2001:2043:be0a:d700:bd32:e7e3:cfbd:5b51]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c39215aa3esm219989e87.40.2026.12.05.04.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 04:58:36 -0800 (PST) Sender: Erik Date: Sat, 5 Dec 2026 13:58:35 +0100 From: Erik Cervin-Edin To: phillip.wood@dunelm.org.uk Cc: Junio C Hamano , git@vger.kernel.org Subject: Re: [PATCH v5 3/3] commit: allow -c/-C for all --fixup variants Message-ID: References: <9ab3665cfc381e54b8412c0bb0dae82b72d2d497.1795867565.git.erik@cervined.in> <17b979e8-670d-4fb5-85bd-17a744a4487e@gmail.com> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17b979e8-670d-4fb5-85bd-17a744a4487e@gmail.com> On 30/11/26 14:28, Phillip Wood wrote: > On 29/11/2026 18:34, Junio C Hamano wrote: > > I however do not see this combination of --fixup and -c covered in new > > tests in t7500. Should we have one, or is it too trivial? Given the main motivation for allowing this was to simplify the logic rather than a need for either --fixup -c or -C, adding full test coverage seemed unnecessary. > It would be nice, but I'm not sure it is essential, it seems a pretty > obscure combination of options. That said, it's cheap, so I propose to flip the 'commit --fixup works with -C' test into 'commit --fixup works with -c': diff --git a/t/t7500-commit-template-squash-signoff.sh b/t/t7500-commit-template-squash-signoff.sh index b9f02d3d2a..510dd11e1e 100755 --- a/t/t7500-commit-template-squash-signoff.sh +++ b/t/t7500-commit-template-squash-signoff.sh @@ -492,13 +492,15 @@ test_expect_success 'commit --fixup works with -F' ' EOF ' -test_expect_success 'commit --fixup works with -C' ' +test_expect_success 'commit --fixup works with -c' ' commit_for_rebase_autosquash_setup && - GIT_EDITOR=false git commit --fixup HEAD~ -C HEAD && + GIT_EDITOR="echo edited >>" git commit --fixup HEAD~ -c HEAD && test_commit_message HEAD <<-EOF fixup! $(git log -1 --format=%s HEAD~2) $(get_commit_msg HEAD~) + + edited EOF ' Dropping the -C test loses little: the editor staying closed for plain --fixup is already checked by the test at line ~298: test_expect_success 'commit --fixup provides correct one-line commit message' ' commit_for_rebase_autosquash_setup && EDITOR="echo ignored >>" git commit --fixup HEAD~1 && commit_msg_is "fixup! target message subject line" ' In the admittedly unlikely event that someone reaches for a combination of options, it seems more likely they would reach for -c, given that the message here is purely for decorative purposes. E.g. "I'm making this fixup for reason X, outlined in commit Y." > > > Helped-by: Junio C Hamano > > > > I do not think I deserve this line as much as others would. Fair. Will credit Phillip instead in next round =) > > > @@ -1396,7 +1401,8 @@ 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; > > > } > > > } > > > > Tricky but true. Naively if you do not have a message you would think > > you want to use editor to give the user a chance to supply one, but that > > is not how this part of the world works. It might deserve a short > > in-code comment why disabling of use_editor is done here and only when > > !edit_message to help future readers. I dunno. Agreed, something like: diff --git a/builtin/commit.c b/builtin/commit.c index 2649506828..8230e71abd 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1401,6 +1401,10 @@ static int parse_and_validate_options(int argc, const char *argv[], } else { fixup_commit = fixup_message; fixup_prefix = "fixup"; + /* + * The fixup! message needs no edit, except with -c, + * which explicitly asks to edit it. + */ if (!edit_message) use_editor = 0; }