git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Joel Klinghed" <the_jk@spawned.biz>
To: "Jeff King" <peff@peff.net>,
	"Joel Klinghed via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] commit: restore --edit when combined with --fixup
Date: Thu, 12 Aug 2021 00:10:28 +0200	[thread overview]
Message-ID: <127626db-302e-426c-a158-35f46205e1d6@www.fastmail.com> (raw)
In-Reply-To: <YRQx/jXdydxMGBmS@coredump.intra.peff.net>



On Wed, Aug 11, 2021, at 22:24, Jeff King wrote:
> On Wed, Aug 11, 2021 at 01:49:18PM +0000, Joel Klinghed via GitGitGadget wrote:
> 
> > From: Joel Klinghed <the_jk@spawned.biz>
> > 
> > Recent changes to --fixup, adding amend suboption, caused the
> > --edit flag to be ignored as use_editor was always set to zero.
> > 
> > Restore edit_flag having higher priority than fixup_message when
> > deciding the value of use_editor by only changing the default
> > if edit_flag is not set.
> 
> This is definitely a change in behavior due to 494d314a05 (commit: add
> amend suboption to --fixup to create amend! commit, 2021-03-15). That
> was in v2.32.0, so it's not a regression in the upcoming v2.33 which
> needs to be handled in the next few days.
> 
> My inclination is to call it a regression and restore the original
> behavior. But when I was going to suggest that you add a test, it made
> me wonder: what would we be testing for?
> 
> If the user says "git commit --fixup HEAD --edit", it seems reasonable
> for them to expect that the editor is run, and that is easy to check.
> But what are they planning to edit? If they modify the subject line of
> the commit, it will wreck the "fixup!" mechanism. If they modify the
> body (which starts blank), it's going to be discarded by the fixup
> operation.
> 
> Is the goal that they might leave notes for themselves, which they can
> view in the meantime before they run "rebase --autosquash"?
> 

At my work we use "fixup!" when pushing fixes to a review, using
the modified body to outline what issue the commit is addressing,
helping the reviewers to see intent and not just the end result.
All "fixup!" are then ofc. squashed before integration.
Same can be achieved with -m but --edit is generally
easier to work with in my experience.

I've also once or twice used it to avoid a "fixup!" of a "fixup!" instead
of looking up the original target commit hash but that's just me being
lazy.

I'll add a test to check for previous behavior.

/JK

  reply	other threads:[~2021-08-11 22:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 13:49 [PATCH] commit: restore --edit when combined with --fixup Joel Klinghed via GitGitGadget
2021-08-11 20:24 ` Jeff King
2021-08-11 22:10   ` Joel Klinghed [this message]
2021-08-11 22:22     ` Jeff King
2021-08-11 23:27     ` brian m. carlson
2021-08-11 23:43 ` [PATCH v2] " Joel Klinghed via GitGitGadget
2021-08-12  5:21   ` Junio C Hamano
2021-08-12  7:42     ` Joel Klinghed
2021-08-12 19:51       ` Junio C Hamano
2021-08-12  8:02   ` [PATCH v3] " Joel Klinghed via GitGitGadget
2021-08-12  9:32     ` Phillip Wood
2021-08-12 10:01       ` Joel Klinghed
2021-08-13 13:06         ` Phillip Wood
2021-08-13 15:35           ` Joel Klinghed
2021-08-14 15:20             ` Phillip Wood
2021-08-14 21:19               ` Joel Klinghed
2021-08-12 11:55     ` [PATCH v4] " Joel Klinghed via GitGitGadget
2021-08-14 21:40       ` [PATCH v5] " Joel Klinghed via GitGitGadget
2021-08-17 10:06         ` Phillip Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=127626db-302e-426c-a158-35f46205e1d6@www.fastmail.com \
    --to=the_jk@spawned.biz \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).