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-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 619421F5AE for ; Thu, 16 Jul 2020 17:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729119AbgGPRcd (ORCPT ); Thu, 16 Jul 2020 13:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728385AbgGPRcc (ORCPT ); Thu, 16 Jul 2020 13:32:32 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC1ECC061755 for ; Thu, 16 Jul 2020 10:32:31 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id o2so12394928wmh.2 for ; Thu, 16 Jul 2020 10:32:31 -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=9hFeyKroMXhJ4hUtuuytTGLjnzZZrnfY5FNHzGLb1AM=; b=OcJTElTqhcsCUle76RDAT6+K7K7DUY8FPsRy9tVPihIT/mtxCsQ0CrLw7ymNnatgC5 FVFpx6vy4xF8vg1qDk5ZNOQVLzYfbsJayt4+XzUVUsaRt7uvBc8DHpVyJ5XSxzXZ3hI5 eM2gbTfuiET/Oz+iG8rEY7I0abV3rSPOiUSd2BjtsXels82scKLmyIQeJU+44mx7wvEa 5bFSpU/BvFonwjX03SdYA6m7ORU0JXoqv4kqTnOnhr18JOkMpAK9GZj15ZsiVmEAX/aP 86Tx+U8BUrD++YHYM4JT255Yse6KSS4F4VKBxzKLgH/an1sEtTKmVFwyi2xSFMgU3KgO LNJQ== 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=9hFeyKroMXhJ4hUtuuytTGLjnzZZrnfY5FNHzGLb1AM=; b=ins4MiFqZNYI6rcVerAA77Wgu9wy5zj9F6Bz+FMjaA6c0FMjKOMuu7GPpo5uQ9d9z/ EyqNarcoH/zey2sVsr4f5g2C0XhH5c+D/5XbUvunMrc+/h8/4BaDRzpe2TZYtaBWrGYB gBah1C9z9P9kTKwoMUUF2/nS51XYQdQXK78nQd1LHFIuEVqcyNgXBjfjpBW/IHXjJn3d scyq/P1FeHFaPDQwFPAW0B+j76JlMSkZuPdy+m7CAYTLPhYzA20m6oDJ88M3gR1upFOV blsYOhPYqBZB1BMyqM1VIVku5BI4gwQqZFtYCsVH0635I/32nz0O4p4h9wkI9A4J3KB6 lRAA== X-Gm-Message-State: AOAM5313Pyr++KA+auwWRssr9OXKyAQshV7GBuBq6jiLP9MDsITS59ap S3ZkCpAjtA1jXzxAt6l4NKM= X-Google-Smtp-Source: ABdhPJye0KfYO9q5lHHfrWQzdYVZtHxbjGiXoHGjWHq3LdZuTH0jrzsJSANlRmEMBN4fYERyvqAztQ== X-Received: by 2002:a05:600c:2f88:: with SMTP id t8mr5255987wmn.186.1594920750384; Thu, 16 Jul 2020 10:32:30 -0700 (PDT) Received: from localhost.localdomain (130.20.198.146.dyn.plus.net. [146.198.20.130]) by smtp.gmail.com with ESMTPSA id q1sm9890020wro.82.2020.07.16.10.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:32:29 -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 v7 1/5] rebase -i: add --ignore-whitespace flag Date: Thu, 16 Jul 2020 18:32:17 +0100 Message-Id: <20200716173221.103295-2-phillip.wood123@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200716173221.103295-1-phillip.wood123@gmail.com> References: <20200407141125.30872-1-phillip.wood123@gmail.com> <20200716173221.103295-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=