From patchwork Wed May 8 00:12:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 10933941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B9A61575 for ; Wed, 8 May 2019 00:13:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DAED28485 for ; Wed, 8 May 2019 00:13:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3271C28696; Wed, 8 May 2019 00:13:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6A8028485 for ; Wed, 8 May 2019 00:13:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726604AbfEHANW (ORCPT ); Tue, 7 May 2019 20:13:22 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35671 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726598AbfEHANV (ORCPT ); Tue, 7 May 2019 20:13:21 -0400 Received: by mail-wr1-f65.google.com with SMTP id w12so11209221wrp.2 for ; Tue, 07 May 2019 17:13:20 -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=/nPZhFSwhVGvg4QzL36QecDUUXIhWHCy9qrnSTrjid0=; b=QflNWJy7HRJg8ZPPXfkC+5dG/OgqEbq2Un9+McN428WCuCV+mV/YyD7MtwQ5E9YO6t kZY9WHM397rgMHcoSgKa2v5KxthpmqfB1orPuUDHCzLddDPkcnIjLV9dmqnNpp6uhdAm SHXlapeAPldliSyfDGW4LMQVPaM76Iy3tT8KiL7IZ52/xgy5qaDzFw5PJM/VrwSkKHtd SNH0AsWUTnXtSdS0uPn0ebtDnQNYPswJc4vXn3VS26wcHJi4XC2v4y76BEDVxXt8LyQ0 9rcSlOB6TvB4TANuwZWJ0AAYkTvpxM18whpxNTdlIaJ1FqAWf9FhJGpfvcJL3ujBIF8o g8WA== 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=/nPZhFSwhVGvg4QzL36QecDUUXIhWHCy9qrnSTrjid0=; b=gjooaaL/FlXj4QMa/NRi7kuZUtkmzCmraR3+kdekTDoRS7k/Cm+JL0W0C3ZZNePm0U v5sxSEmV3gBa74ht6o+5kCGBsse25oCqY7rSOizUf938k+20neI40SHWzVFqgrfvxkUD RsknKgoJ5B2iSrmC8ZNEyVtbDjCrLfHPv+3hjnJf4sxmQjcvJ8qyXa6axfGiunokiej7 O1CFKC/HOAXO793UeEVjo3upeeGPaVJFNtHpcj74AnUE0Bp2YTebVB0IYrCiIPPlUCod N95jFjlRANOj7g8ZdQ7dlF3U8Th0JF3K1wjX117QUnGhVqCNdxNcEJR6qgBUPtxxcDRz GbrQ== X-Gm-Message-State: APjAAAUA758yjOKdey8beO1kPONM5FT0Clw1gjoqwV65CjpijRH9xhKc I0luHjJnEPQrnDpL4P/7KiURBQu7Y38= X-Google-Smtp-Source: APXvYqz1303ow1kl3gI+jU8cP14tPQLfwxqrsUytkRY5/zL4cax4RQ/qan5SPWD3gRcdQ8LeJrsNRQ== X-Received: by 2002:adf:fc42:: with SMTP id e2mr18517320wrs.1.1557274399594; Tue, 07 May 2019 17:13:19 -0700 (PDT) Received: from vm.nix.is ([2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n15sm5167825wrp.58.2019.05.07.17.13.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 07 May 2019 17:13:18 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Denton Liu , Eric Sunshine , Johannes Schindelin , Johannes Sixt , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?b?w4Z2YXIg?= =?utf-8?b?QXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [RFC WIP PATCH v8 09/13] rebase tests: test linear branch topology Date: Wed, 8 May 2019 02:12:48 +0200 Message-Id: <20190508001252.15752-10-avarab@gmail.com> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a In-Reply-To: References: MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add tests rebasing a linear branch topology to linear rebase tests added in 2aad7cace2 ("add simple tests of consistency across rebase types", 2013-06-06). These tests are duplicates of two surrounding tests that do the same with tags pointing to the same objects. Right now there's no change in behavior being introduced, but as we'll see in a subsequent change rebase can have different behaviors when working implicitly with remote tracking branches. While I'm at it add a --fork-point test, strictly speaking this is redundant to the existing '' test, as no argument to rebase implies --fork-point. But now it's easier to grep for tests that explicitly stress --fork-point. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t3421-rebase-topology-linear.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/t/t3421-rebase-topology-linear.sh b/t/t3421-rebase-topology-linear.sh index 7274dca40b..b847064f91 100755 --- a/t/t3421-rebase-topology-linear.sh +++ b/t/t3421-rebase-topology-linear.sh @@ -31,6 +31,16 @@ test_run_rebase success -m test_run_rebase success -i test_have_prereq !REBASE_P || test_run_rebase success -p +test_expect_success 'setup branches and remote tracking' ' + git tag -l >tags && + for tag in $(cat tags) + do + git branch branch-$tag $tag || return 1 + done && + git remote add origin "file://$PWD" && + git fetch origin +' + test_run_rebase () { result=$1 shift @@ -57,10 +67,28 @@ test_run_rebase () { " } test_run_rebase success '' +test_run_rebase success --fork-point test_run_rebase success -m test_run_rebase success -i test_have_prereq !REBASE_P || test_run_rebase failure -p +test_run_rebase () { + result=$1 + shift + test_expect_$result "rebase $* -f rewrites even if remote upstream is an ancestor" " + reset_rebase && + git rebase $* -f branch-b branch-e && + ! test_cmp_rev branch-e origin/branch-e && + test_cmp_rev branch-b HEAD~2 && + test_linear_range 'd e' branch-b.. + " +} +test_run_rebase success '' +test_run_rebase success --fork-point +test_run_rebase success -m +test_run_rebase success -i +test_have_prereq !REBASE_P || test_run_rebase success -p + test_run_rebase () { result=$1 shift @@ -71,6 +99,7 @@ test_run_rebase () { " } test_run_rebase success '' +test_run_rebase success --fork-point test_run_rebase success -m test_run_rebase success -i test_have_prereq !REBASE_P || test_run_rebase success -p