From patchwork Mon Aug 7 17:09:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oswald Buddenhagen X-Patchwork-Id: 13344610 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE12BC41513 for ; Mon, 7 Aug 2023 17:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231351AbjHGRJj (ORCPT ); Mon, 7 Aug 2023 13:09:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229998AbjHGRJh (ORCPT ); Mon, 7 Aug 2023 13:09:37 -0400 Received: from bluemchen.kde.org (bluemchen.kde.org [IPv6:2001:470:142:8::100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A7A4B1 for ; Mon, 7 Aug 2023 10:09:36 -0700 (PDT) Received: from ugly.fritz.box (localhost [127.0.0.1]) by bluemchen.kde.org (Postfix) with ESMTP id A756624289; Mon, 7 Aug 2023 13:09:35 -0400 (EDT) Received: by ugly.fritz.box (masqmail 0.3.6-dev, from userid 1000) id 1qT3jb-nsP-00; Mon, 07 Aug 2023 19:09:35 +0200 From: Oswald Buddenhagen To: git@vger.kernel.org Cc: Phillip Wood Subject: [PATCH 1/3] t/lib-rebase: set_fake_editor(): fix recognition of reset's short command Date: Mon, 7 Aug 2023 19:09:33 +0200 Message-Id: <20230807170935.2336663-2-oswald.buddenhagen@gmx.de> X-Mailer: git-send-email 2.40.0.152.g15d061e6df In-Reply-To: <20230807170935.2336663-1-oswald.buddenhagen@gmx.de> References: <20230807170935.2336663-1-oswald.buddenhagen@gmx.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org ... in FAKE_LINES. This has been broken ever since it was introduced in 5dcdd7409a (t/lib-rebase: prepare for testing `git rebase --rebase-merges`, 2019-07-31), but it's not actually used, so it's a cosmetic defect only. Signed-off-by: Oswald Buddenhagen --- Cc: Phillip Wood --- t/lib-rebase.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh index 7ca5b918f0..e6179ab529 100644 --- a/t/lib-rebase.sh +++ b/t/lib-rebase.sh @@ -49,7 +49,7 @@ set_fake_editor () { action=\& for line in $FAKE_LINES; do case $line in - pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|r|merge|m) + pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|t|merge|m) action="$line";; exec_*|x_*|break|b) echo "$line" | sed 's/_/ /g' >> "$1";; From patchwork Mon Aug 7 17:09:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oswald Buddenhagen X-Patchwork-Id: 13344613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D0ABC04A6A for ; Mon, 7 Aug 2023 17:09:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231861AbjHGRJo (ORCPT ); Mon, 7 Aug 2023 13:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231324AbjHGRJi (ORCPT ); Mon, 7 Aug 2023 13:09:38 -0400 Received: from bluemchen.kde.org (bluemchen.kde.org [209.51.188.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B7EE65 for ; Mon, 7 Aug 2023 10:09:36 -0700 (PDT) Received: from ugly.fritz.box (localhost [127.0.0.1]) by bluemchen.kde.org (Postfix) with ESMTP id A595324228; Mon, 7 Aug 2023 13:09:35 -0400 (EDT) Received: by ugly.fritz.box (masqmail 0.3.6-dev, from userid 1000) id 1qT3jb-nsV-00; Mon, 07 Aug 2023 19:09:35 +0200 From: Oswald Buddenhagen To: git@vger.kernel.org Cc: Phillip Wood Subject: [PATCH 2/3] t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently Date: Mon, 7 Aug 2023 19:09:34 +0200 Message-Id: <20230807170935.2336663-3-oswald.buddenhagen@gmx.de> X-Mailer: git-send-email 2.40.0.152.g15d061e6df In-Reply-To: <20230807170935.2336663-1-oswald.buddenhagen@gmx.de> References: <20230807170935.2336663-1-oswald.buddenhagen@gmx.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Default next action after 'fakesha' to preserving the command instead of forcing 'pick', consistently with other "instant-effect" keywords. There is no reason why one would want that inconsistency, so this was clearly just an oversight in commit 5dcdd740 ("t/lib-rebase: prepare for testing `git rebase --rebase-merges`"). Rectifying it makes the behavior easier to reason about and document. This would affect hypothetical "fakesha " sequences where line already isn't a pick, which currently don't appear. Signed-off-by: Oswald Buddenhagen --- Cc: Phillip Wood --- t/lib-rebase.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh index e6179ab529..9ed87ca7ab 100644 --- a/t/lib-rebase.sh +++ b/t/lib-rebase.sh @@ -64,7 +64,7 @@ set_fake_editor () { fakesha) test \& != "$action" || action=pick echo "$action XXXXXXX False commit" >> "$1" - action=pick;; + action=\&;; *) sed -n "${line}s/^[a-z][a-z]*/$action/p" < "$1".tmp >> "$1" action=\&;; From patchwork Mon Aug 7 17:09:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oswald Buddenhagen X-Patchwork-Id: 13344611 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABE44C001B0 for ; Mon, 7 Aug 2023 17:09:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231744AbjHGRJk (ORCPT ); Mon, 7 Aug 2023 13:09:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231248AbjHGRJi (ORCPT ); Mon, 7 Aug 2023 13:09:38 -0400 Received: from bluemchen.kde.org (bluemchen.kde.org [209.51.188.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37948E63 for ; Mon, 7 Aug 2023 10:09:36 -0700 (PDT) Received: from ugly.fritz.box (localhost [127.0.0.1]) by bluemchen.kde.org (Postfix) with ESMTP id AC8F024298; Mon, 7 Aug 2023 13:09:35 -0400 (EDT) Received: by ugly.fritz.box (masqmail 0.3.6-dev, from userid 1000) id 1qT3jb-nsb-00; Mon, 07 Aug 2023 19:09:35 +0200 From: Oswald Buddenhagen To: git@vger.kernel.org Cc: Phillip Wood Subject: [PATCH 3/3] t/lib-rebase: improve documentation of set_fake_editor() Date: Mon, 7 Aug 2023 19:09:35 +0200 Message-Id: <20230807170935.2336663-4-oswald.buddenhagen@gmx.de> X-Mailer: git-send-email 2.40.0.152.g15d061e6df In-Reply-To: <20230807170935.2336663-1-oswald.buddenhagen@gmx.de> References: <20230807170935.2336663-1-oswald.buddenhagen@gmx.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org - Make it reflect better what actually happens. This makes it easier to fully exploit the possibilities and to modify the code. - Improve the structure, putting more general info further up. - Document `fakesha` and `break`. Signed-off-by: Oswald Buddenhagen --- Cc: Phillip Wood --- t/lib-rebase.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh index 9ed87ca7ab..184b25b427 100644 --- a/t/lib-rebase.sh +++ b/t/lib-rebase.sh @@ -8,18 +8,21 @@ # - check that non-commit messages have a certain line count with $EXPECT_COUNT # - check the commit count in the commit message header with $EXPECT_HEADER_COUNT # - rewrite a rebase -i script as directed by $FAKE_LINES. -# $FAKE_LINES consists of a sequence of words separated by spaces. -# The following word combinations are possible: +# $FAKE_LINES consists of a sequence of words separated by spaces; +# spaces inside the words are encoded as underscores. +# The following words are possible: # -# "" -- add a "pick" line with the SHA1 taken from the -# specified line. +# "" -- override the command for the next line specification. Can be +# "pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword", +# "drop", "merge[_-{c|C}_]", or "bad" for an invalid command. # -# " " -- add a line with the specified command -# ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop") -# and the SHA1 taken from the specified line. +# "" -- add a command, using the specified line as a template. +# If the command has not been overridden, the line will be copied +# verbatim, usually resulting in a "pick" line. # -# "_" -- add a space, like "fixup_-C" implies "fixup -C" and -# "exec_cmd_with_args" add an "exec cmd with args" line. +# "fakesha" -- add a command ("pick" by default), using a fake SHA1. +# +# "exec_[...]", "break" -- add the specified command. # # "#" -- Add a comment line. #