From patchwork Fri Jun 26 09:55:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood X-Patchwork-Id: 11627001 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84981161F for ; Fri, 26 Jun 2020 09:55:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 623F320679 for ; Fri, 26 Jun 2020 09:55:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WNAtT2vd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726959AbgFZJzk (ORCPT ); Fri, 26 Jun 2020 05:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbgFZJzk (ORCPT ); Fri, 26 Jun 2020 05:55:40 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2E4DC08C5C1 for ; Fri, 26 Jun 2020 02:55:39 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id j4so6413795wrp.10 for ; Fri, 26 Jun 2020 02:55:39 -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=wfk0jUYVOBM8bmZlbi3NfHKNDOZDKMPvfo0VTBin2UM=; b=WNAtT2vddjA8oxZmkKDMbbUhNskxqu3qQDWCC1+wANt6pwpLslxY8KQddB5aDfWtkc 1RD+Q7pijCDPI7K54W/0HJMouxqPE7ISRfMhDvq6SeUqdazfxJEeElru+ANpT1XYjUoh VnWRV5FuigiPipAS0u5RsaeGo+00FDOV8SeY53isbNBSmGM2BlgaZHahbzD9Biy3qPif g4qlIaGrJoHZh6zc5J8ADa6P3KX9Kavv6DhCdmHCp0c95O4oc4Mix3XnIAIvuSAKt/nQ P0oWQRqQzJkDe4I3sAdDfi28CpAnJkYcPVnbr1KDoVJbWINSvfi8gfDtd4GB1g3wHRjh /QOA== 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=wfk0jUYVOBM8bmZlbi3NfHKNDOZDKMPvfo0VTBin2UM=; b=Lvsy/BuPZrYrzpz9/TYn6RR6Zgfhv2ZoXIB5J7j4SJ+URzMqVehLOv9OZyftAFkexn AqMAfM/Ui+XLIfMQ+b7JI9q8MHh2MMjaSaLCn6zsxNHuoNo1PnEnM8QIPNouhofnUbb/ IBtNN52fAphDpkU/FRYt7YZyY2hz/PDXoeIKDmszG55otKOpyMLSk5/QpNV7ifiA3Yvl +b3EvzGgsz+dJryVNsKo2Kr2HBGUraiSLC/3LFjHKA4iv6c6e7kyGs4jS2fyr5us+rWh B5MaiR/QFpKsl8TtZlF3kf669mJ/EJfH6Wy3eSJ8Dw2NWkP7hf0f9o+b9nN4h3dDjyii NyHA== X-Gm-Message-State: AOAM532/JhyKjSaRkCSwCLVJu7k37MQYeXYGNv/hajRNi8jecomaW6G+ ZCuWxp8BxhA0MpC751+fLyy9gaKq X-Google-Smtp-Source: ABdhPJyTYf4YDa1AoBWmoAwPh1+Y6WSAf3vxL126kN0tWLaXCleEyoKbFVEGKGjZbPdv/ok9b+c46w== X-Received: by 2002:adf:e38b:: with SMTP id e11mr2811977wrm.65.1593165338571; Fri, 26 Jun 2020 02:55:38 -0700 (PDT) Received: from localhost.localdomain (226.20.198.146.dyn.plus.net. [146.198.20.226]) by smtp.gmail.com with ESMTPSA id n14sm14327755wro.81.2020.06.26.02.55.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 02:55:37 -0700 (PDT) From: Phillip Wood To: Johannes Schindelin , Junio C Hamano , Elijah Newren , Rohit Ashiwal , =?utf-8?b?xJBvw6BuIFRy4bqnbiBD?= =?utf-8?b?w7RuZyBEYW5o?= , Alban Gruin , Git Mailing List Cc: Phillip Wood Subject: [PATCH v5 1/5] rebase -i: add --ignore-whitespace flag Date: Fri, 26 Jun 2020 10:55:24 +0100 Message-Id: <20200626095528.117524-2-phillip.wood123@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200626095528.117524-1-phillip.wood123@gmail.com> References: <20200407141125.30872-1-phillip.wood123@gmail.com> <20200626095528.117524-1-phillip.wood123@gmail.com> Reply-To: Phillip Wood MIME-Version: 1.0 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 | 16 +++++-- t/t3422-rebase-incompatible-options.sh | 1 - t/t3436-rebase-more-options.sh | 60 ++++++++++++++++++++++++++ 4 files changed, 90 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=