From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 7ED621F8C6 for ; Fri, 27 Aug 2021 02:08:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243960AbhH0CFr (ORCPT ); Thu, 26 Aug 2021 22:05:47 -0400 Received: from cloud.peff.net ([104.130.231.41]:60334 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231588AbhH0CFr (ORCPT ); Thu, 26 Aug 2021 22:05:47 -0400 Received: (qmail 5325 invoked by uid 109); 27 Aug 2021 02:04:59 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 27 Aug 2021 02:04:59 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 11050 invoked by uid 111); 27 Aug 2021 02:04:58 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 26 Aug 2021 22:04:58 -0400 Authentication-Results: peff.net; auth=none Date: Thu, 26 Aug 2021 22:04:58 -0400 From: Jeff King To: Konstantin Kharlamov Cc: git@vger.kernel.org Subject: Re: How to interactively rebase-and-reword nth commit? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Aug 25, 2021 at 05:06:03PM +0300, Konstantin Kharlamov wrote: > Any ideas, how can I tell `git` that I want to "reword" nth commit right away? Sure, > I am not the first one to stumble upon it, am I? Any ideas? Have you looked at the new --fixup options in 2.32? E.g.: git commit --fixup reword:HEAD~2 will immediately drop you in an editor to adjust the commit message. The result is a new "fixup" commit which is then applied when you autosquash. So you could do multiple such adjustments, and then: GIT_EDITOR=: git rebase -i --autosquash to apply them all to the appropriate spots. -Peff