From patchwork Sat Sep 7 11:50:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Ashiwal X-Patchwork-Id: 11136455 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 122491708 for ; Sat, 7 Sep 2019 11:51:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6B5621871 for ; Sat, 7 Sep 2019 11:51:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="diSzemuw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733054AbfIGLvB (ORCPT ); Sat, 7 Sep 2019 07:51:01 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42596 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728129AbfIGLvB (ORCPT ); Sat, 7 Sep 2019 07:51:01 -0400 Received: by mail-pf1-f194.google.com with SMTP id w22so6285104pfi.9 for ; Sat, 07 Sep 2019 04:51:00 -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 :mime-version:content-transfer-encoding; bh=bfLkpI+MxJTsj1WksAPKdLj9fbvrvbTAEj39Xk+0BSw=; b=diSzemuwM25Qp71VT/zCTcXBmB7OhyKroB6JBHIsnIux/hPFgyJpX4xvhR3B2JdKH7 f6yp9wmqt/JXGkwa1jR0pO1QIZXcCr8FVmCdYXhlH2fjo1PTYn3fKUZIhqSqFlyjAWrg 4+NoT/iaRksH+LGxJI25yP5Rq0cNi5jmCbUPEewT0zqNkA7CNzW8aEkuoxJXQGvdCth/ GB71hZySx49/OZ/QaVNvG772Bgv9qaXmyPvygwO77poM4l031vBUaR+a5nhsy649PEOQ ls4yIqroTQWak16zYPuUTgVM3NZ8Q+eN30kzmW+tlYSsd0RYRospaTtHZw2ndzB580Ah yN0A== 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:mime-version:content-transfer-encoding; bh=bfLkpI+MxJTsj1WksAPKdLj9fbvrvbTAEj39Xk+0BSw=; b=H+zRgIOUY4PFbDOLn2jY3oCKJPl5H4JkIZzmWBH3G37otJKdo8wI1p/W9hZR/Olhwx /NPaZt4yNAdulkTW+RNPVD37DlC6cSAcIifpDJLWv/gGXwvRiHXFCJIUrMpZpB09zXwk qMMtH9DyNNugsKHZiIGv2bGEHdIbqmZwZ9k8FCEslrafjLMCsVjfIWC/Hf8/1sRi9++F bh7pUCRM+XwsYUZ4IlLp3Jkhf2xupHcNNLAb3IxEvbfKyK6yNbhgbLtxhLmmnsVmK/Wz 2uGhb9LA2BUzZ0VwK5yOcjy+EHm/VcXg6AtqM3EYYEjd6o8aG/XCywF64WmFTgUXR2nK NBqA== X-Gm-Message-State: APjAAAVh1XcA8SHSgIvpZzJlHnNVGnIMME1esn2+J44VSUOkUiQHskbJ dcs9Eo8tIi9cPFMk6U7Rb/4= X-Google-Smtp-Source: APXvYqwvlUvL/cPYHIUKbW6AKdhskwOkj7k8GhZbWkS0Aq8lIiwR6TNSMcrpB4xyaKpoaSFIQ+X6ew== X-Received: by 2002:a63:2148:: with SMTP id s8mr11998104pgm.336.1567857059714; Sat, 07 Sep 2019 04:50:59 -0700 (PDT) Received: from ar135.mshome.net ([103.37.200.225]) by smtp.gmail.com with ESMTPSA id a11sm18134792pfg.94.2019.09.07.04.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 04:50:59 -0700 (PDT) From: Rohit Ashiwal To: rohit.ashiwal265@gmail.com Cc: Johannes.Schindelin@gmx.de, git@vger.kernel.org, gitster@pobox.com, martin.agren@gmail.com, newren@gmail.com, phillip.wood123@gmail.com, t.gummerer@gmail.com Subject: [PATCH v4 1/6] rebase -i: add --ignore-whitespace flag Date: Sat, 7 Sep 2019 17:20:29 +0530 Message-Id: <20190907115034.14933-2-rohit.ashiwal265@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190907115034.14933-1-rohit.ashiwal265@gmail.com> References: <20190806173638.17510-1-rohit.ashiwal265@gmail.com> <20190907115034.14933-1-rohit.ashiwal265@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There are two backends available for rebasing, viz, the am and the interactive. Naturally, there shall be some features that are implemented in one but not in the other. One such flag is --ignore-whitespace which indicates merge mechanism to treat lines with only whitespace changes as unchanged. Wire the interactive rebase to also understand the --ignore-whitespace flag by translating it to -Xignore-space-change. Signed-off-by: Rohit Ashiwal --- Documentation/git-rebase.txt | 13 ++++- builtin/rebase.c | 22 +++++++-- t/t3422-rebase-incompatible-options.sh | 1 - t/t3433-rebase-options-compatibility.sh | 65 +++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 7 deletions(-) create mode 100755 t/t3433-rebase-options-compatibility.sh diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index 6156609cf7..873eb5768c 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -371,8 +371,16 @@ If either or --root is given on the command line, then the default is `--no-fork-point`, otherwise the default is `--fork-point`. --ignore-whitespace:: + Behaves differently depending on which backend is selected. ++ +'am' backend: When applying a patch, ignore changes in whitespace in +context lines if necessary. ++ +'interactive' backend: Treat lines with only whitespace changes as +unchanged for the sake of a three-way merge. + --whitespace=