From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 770D4C433E1 for ; Mon, 17 Aug 2020 17:41:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5343C20738 for ; Mon, 17 Aug 2020 17:41:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uG3BAjPl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731481AbgHQRlE (ORCPT ); Mon, 17 Aug 2020 13:41:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731469AbgHQRkS (ORCPT ); Mon, 17 Aug 2020 13:40:18 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08C83C061343 for ; Mon, 17 Aug 2020 10:40:17 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id a14so15818314wra.5 for ; Mon, 17 Aug 2020 10:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=cKo0/VMRtvJyblJ4c0yERNd4jXZ3OokpaAL/HM/CGTk=; b=uG3BAjPlVhIBMTRWii55f8R2TGTfOb/tcfa7k7LfTVg/BA4sCxer7OsN8P2f44UHcW m5E70U0mjWARN5IcNhzHBTEqNA6vVqXMVnjLVXiMF2lk2SNXxYec8dlXzGbEMuua5m56 vYgyI+r1C6IJFAeYeTjuyBx0zAxdKDvgMcvF22Fyixha8Y5jyeACGPoI55gvbiLccnZQ /JqZz4vKinz3sOpYPkE4SQponcAqGYbfKWbkYI9cdgpnuPfSMUtAfCzopMPIHATPB28b 3iYtDl7MBipwc24rVuqPaNT61C8OjXwugJO6gLhQrZa8WxfmdDvjeK0dPEyx5HoWUgcV l4Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=cKo0/VMRtvJyblJ4c0yERNd4jXZ3OokpaAL/HM/CGTk=; b=EaacRmUqHOhRJlcDm18GEkrNNPj5BWRbEdIvPN2hzB1W3GfhYKl9KCHwWyren16LDV Jw9hhy8VZ6Ot+Pt0610nwYqKeCPIBrW54I+fv/MNYLp1MGrQ5l/1sil/D7A7D53nBf0y vk1QoB9DDjexzs1Ut1BlDvokTBTSVSVxpL5pZMGBSHr4JLkcosiC1xgMo7JpQsbCK5Zg ntUxVyWJOoXauxDRyBwh5x71EDFXCI1juW0Co47KxQuJQFuhpnOzZtI6hSRfp43kyPaV nI5PKvCwZRIAG7Rjdt/k4x+y87JCzAXfv9RphHMKt4njB4YwarHW7oBrdgVRoW5c5Ms6 ED5g== X-Gm-Message-State: AOAM531OmgjA36/MKiYYN87jd0vFg5uEQ07SB8tWXqFNHnixQfdX1Sy+ CnGtxvTe3gPIMN5vbmg8bhA= X-Google-Smtp-Source: ABdhPJztip9K02UTpOjI/VBG+sRm5+P+08lalYpgDvD+jag16sVwI/+BQmXnTJdu6e32M8E4FJiDNw== X-Received: by 2002:a5d:5084:: with SMTP id a4mr17005785wrt.191.1597686014398; Mon, 17 Aug 2020 10:40:14 -0700 (PDT) Received: from localhost.localdomain (192.252.189.80.dyn.plus.net. [80.189.252.192]) by smtp.gmail.com with ESMTPSA id l10sm31252058wru.3.2020.08.17.10.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 10:40:13 -0700 (PDT) From: Phillip Wood To: Johannes Schindelin , Junio C Hamano , Elijah Newren , Rohit Ashiwal , =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= , Alban Gruin , Git Mailing List Cc: Phillip Wood Subject: [PATCH v8 1/5] rebase -i: add --ignore-whitespace flag Date: Mon, 17 Aug 2020 18:40:00 +0100 Message-Id: <20200817174004.92455-2-phillip.wood123@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817174004.92455-1-phillip.wood123@gmail.com> References: <20200407141125.30872-1-phillip.wood123@gmail.com> <20200817174004.92455-1-phillip.wood123@gmail.com> Reply-To: Phillip Wood MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Rohit Ashiwal Rebase is implemented with two different backends - 'apply' and 'merge' each of which support a different set of options. In particular the apply backend supports a number of options implemented by 'git am' that are not implemented in the merge backend. This means that the available options are different depending on which backend is used which is confusing. This patch adds support for the --ignore-whitespace option to the merge backend. This option treats lines with only whitespace changes as unchanged and is implemented in the merge backend by translating it to -Xignore-space-change. Signed-off-by: Rohit Ashiwal Signed-off-by: Phillip Wood --- Documentation/git-rebase.txt | 19 +++++++- builtin/rebase.c | 19 ++++++-- t/t3422-rebase-incompatible-options.sh | 1 - t/t3436-rebase-more-options.sh | 60 ++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 6 deletions(-) create mode 100755 t/t3436-rebase-more-options.sh diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index f7a6033607..b003784f01 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -422,8 +422,23 @@ your branch contains commits which were dropped, this option can be used with `--keep-base` in order to drop those commits from your branch. --ignore-whitespace:: + Ignore whitespace differences when trying to reconcile +differences. Currently, each backend implements an approximation of +this behavior: ++ +apply backend: When applying a patch, ignore changes in whitespace in +context lines. Unfortunately, this means that if the "old" lines being +replaced by the patch differ only in whitespace from the existing +file, you will get a merge conflict instead of a successful patch +application. ++ +merge backend: Treat lines with only whitespace changes as unchanged +when merging. Unfortunately, this means that any patch hunks that were +intended to modify whitespace and nothing else will be dropped, even +if the other side had no changes that conflicted. + --whitespace=