From patchwork Thu Oct 8 10:13:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11822579 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=-9.8 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,URIBL_BLOCKED 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 86779C43467 for ; Thu, 8 Oct 2020 10:13:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 235D921734 for ; Thu, 8 Oct 2020 10:13:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UOXwMiwZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729380AbgJHKN4 (ORCPT ); Thu, 8 Oct 2020 06:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729341AbgJHKNx (ORCPT ); Thu, 8 Oct 2020 06:13:53 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34A75C0613D2 for ; Thu, 8 Oct 2020 03:13:53 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id n18so5942271wrs.5 for ; Thu, 08 Oct 2020 03:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=nw3krdT6vhbog0t2sxP9jCDiqirm4Sz3ePFWwZ4HrgM=; b=UOXwMiwZtYbgoliYIkmHJZWLeuohKDpg6eQJDyW5/DgbXQG0qzI9Rw7dhVzPqfbzDn wMYkeAaS8/LjeMSGZisHAOrt52Q2t27UkuJqW4UvHnIeVDmLg3aVaxneo97cB/qcz4YO aJh2rkjLyEtnyWf9etI+G9TI05b7drf7hvpSy0/8E/JM19BTdjaS2ZQaEIA7FsFfI3GF 4l59ZB73EP7QOKjYK043+kjh8bFLHSd2ob80Xn3i+nTec8xf1e3lZqHcXf9OCs9Ynpfm 4ajOCLR0NEpYYkDe9tbVPp509K6VLmrLcdcF1pNJQdqsmUJdzc3YwUCyKlfwRx8xaDgK pGnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=nw3krdT6vhbog0t2sxP9jCDiqirm4Sz3ePFWwZ4HrgM=; b=q/b1yTaKZ+wYCS2jehr6PDJIG91SxqylcTsspqvASXTtzWi4bKXRD9Iz2Y4opnUCF6 TH49X3wiY75Z193MattKZkdXu3VsIciEzM+EfP5TrERTzLTmWhv/ca1wPj+FHu/tA3f4 du+RcjbbfZppyQaJnuSoY1rM1BTR5OdXaX4mwwtA2ActHz0inZDRQVUGwGzPnitUY6Or QBWSSVXOAyYGc7UAsSywKgTcKFyhWPaEG75nRZBU2Zn5yC0UGhgwG3RSARd9UX6PcNeW owyVYovNTLbo1sb88p0+wfJiML2xHtuiw88MmQXLLvNcPjQATp10ya25PWOy8Docuz26 PNww== X-Gm-Message-State: AOAM533bd879E3wPdSWhWMBWzDt+2KmnjDBIZS31WD+8JvyPB8AVTM/D fSV7nxqMFD2djMVk2ILE5fzbZA8bfPY= X-Google-Smtp-Source: ABdhPJzRXKvZ3wioTP30HWFydY16Xak+GfkUYbDyU3kN1A89s913d6pSKuWgTqylLtRIy4OugbV7ow== X-Received: by 2002:a5d:5449:: with SMTP id w9mr8938547wrv.182.1602152029960; Thu, 08 Oct 2020 03:13:49 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z1sm6322948wmk.45.2020.10.08.03.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 03:13:49 -0700 (PDT) Message-Id: <2c6f41f9adf361dd700fefaf0fa7819720929c04.1602152027.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Thu, 08 Oct 2020 10:13:46 +0000 Subject: [PATCH v2 1/2] t1415: avoid using `main` as ref name Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jonathan Nieder , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin In preparation for a patch series that will change the fall-back for `init.defaultBranch` to `main`, let's not use `main` as ref name in this test script. Otherwise, the `git for-each-ref ... | grep main` which wants to catch those refs would also unexpectedly catch `refs/heads/main`. Since the refs in question are worktree-local ones (i.e. each worktree has their own, just like `HEAD`), and since the test case already uses a secondary worktree called "second", let's use the name "first" for those refs instead. While at it, adjust the test titles that talk about a "repo" when they meant a "worktree" instead. Signed-off-by: Johannes Schindelin --- t/t1415-worktree-refs.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh index bb2c7572a3..7ab91241ab 100755 --- a/t/t1415-worktree-refs.sh +++ b/t/t1415-worktree-refs.sh @@ -76,24 +76,24 @@ test_expect_success 'reflog of worktrees/xx/HEAD' ' test_cmp expected actual.wt2 ' -test_expect_success 'for-each-ref from main repo' ' +test_expect_success 'for-each-ref from main worktree' ' mkdir fer1 && git -C fer1 init repo && test_commit -C fer1/repo initial && git -C fer1/repo worktree add ../second && - git -C fer1/repo update-ref refs/bisect/main HEAD && - git -C fer1/repo update-ref refs/rewritten/main HEAD && - git -C fer1/repo update-ref refs/worktree/main HEAD && - git -C fer1/repo for-each-ref --format="%(refname)" | grep main >actual && + git -C fer1/repo update-ref refs/bisect/first HEAD && + git -C fer1/repo update-ref refs/rewritten/first HEAD && + git -C fer1/repo update-ref refs/worktree/first HEAD && + git -C fer1/repo for-each-ref --format="%(refname)" | grep first >actual && cat >expected <<-\EOF && - refs/bisect/main - refs/rewritten/main - refs/worktree/main + refs/bisect/first + refs/rewritten/first + refs/worktree/first EOF test_cmp expected actual ' -test_expect_success 'for-each-ref from linked repo' ' +test_expect_success 'for-each-ref from linked worktree' ' mkdir fer2 && git -C fer2 init repo && test_commit -C fer2/repo initial && From patchwork Thu Oct 8 10:13:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11822581 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=-9.8 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,URIBL_BLOCKED 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 ABC01C04EBE for ; Thu, 8 Oct 2020 10:13:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51B3F21734 for ; Thu, 8 Oct 2020 10:13:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fVNCipDR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729371AbgJHKN4 (ORCPT ); Thu, 8 Oct 2020 06:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729132AbgJHKNx (ORCPT ); Thu, 8 Oct 2020 06:13:53 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97FCBC061755 for ; Thu, 8 Oct 2020 03:13:52 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id d81so5850958wmc.1 for ; Thu, 08 Oct 2020 03:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=RI/d+s0gn77O8vNnltMe6zcegg4uB0hNZtoIx2DLJik=; b=fVNCipDRQXKpmJ2b3oNoBsDhrlLpC36E0H4wZ8yxRuR1rV397bSlmRx4050Lw0kjZF +eV4jD+N1azbwxos8XJQZ5UMYwVW3slp20X31vr18cRegNVpxx9lBOL2XPwxzSj+sGWw HurR0Y5M/LmyQ+ekweSWUzEO6Bqr7KJthcX7nMgYNwhJmZMvTbq2jAUx1ud8w+dZvW+t FZLoZHxW9LBaoyBr7rb1/4e8EbiI67oZAHPIynObbpXxQPtPTEzD3C8f12yJlRz7r+zd A/7K48QpMk/M5rMT9ps2PX+/xD/guUu+xz+QTEWj0fOQRMfeA7pF+4VOYKo/k55opl1M NERA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=RI/d+s0gn77O8vNnltMe6zcegg4uB0hNZtoIx2DLJik=; b=cHGAsjKOZdkAk8OFtjkZK6RE0P3nADtdhNH4v5MTikRupWVB29D31O+J+XnTeAG4Fk 4e2mkunpRIh1HwuYAw1on+v16nKtsTT3+9Q/0C1b4Jh2SOY7JvPIoDfgHiuZZril9+C4 enzGdp4nPjMFGIypwwNEd1uluFuWAoo125OvarqXARptOLuhg+SQSuNBTZlhXsJ/DUmQ PLf12TdaTlNKKAs8koLHxRUQnPdMlnBWidyNLgGFy7F9t9eR+NMzKtnKJdsCf6fDXG8u ApMRAivisjD6hffN1jSfzwJrxOU8IBvJZA7ARcHXXj7jc5yl2FipWsfmbCF/DZ6viPmt 2xyQ== X-Gm-Message-State: AOAM5328/nzMo07H0i+M3bJpVtZCnzUREuQEVtNEukjPTXCYcf9enysO 7u1XOGu8VJ1MTKpSQ8In2VjRM6PrzQI= X-Google-Smtp-Source: ABdhPJznofdZfSMRE9xwTFAP0tyGw5TuiKjofodqvrx555kfgJXrFw3mgQ9NvWVO8P8+iPKMopnHMw== X-Received: by 2002:a1c:40d5:: with SMTP id n204mr7744326wma.148.1602152031077; Thu, 08 Oct 2020 03:13:51 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m11sm6277880wmf.10.2020.10.08.03.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 03:13:50 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Thu, 08 Oct 2020 10:13:47 +0000 Subject: [PATCH v2 2/2] tests: avoid using the branch name `main` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jonathan Nieder , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin In the near future, we want to change Git's default branch name to `main`. In preparation for that, stop using it as a branch name in the test suite. Replace that branch name by `topic`, the same name we used to rename variations of `master` in b6211b89eb3 (tests: avoid variations of the `master` branch name, 2020-09-26). Signed-off-by: Johannes Schindelin --- t/t6012-rev-list-simplify.sh | 8 ++++---- t/t6400-merge-df.sh | 8 ++++---- t/t6409-merge-subtree.sh | 12 ++++++------ t/t6430-merge-recursive.sh | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/t/t6012-rev-list-simplify.sh b/t/t6012-rev-list-simplify.sh index b6fa43ace0..7fc10f8593 100755 --- a/t/t6012-rev-list-simplify.sh +++ b/t/t6012-rev-list-simplify.sh @@ -171,7 +171,7 @@ test_expect_success '--full-diff is not affected by --parents' ' test_expect_success 'rebuild repo' ' rm -rf .git * && git init && - git switch -c main && + git switch -c topic && echo base >file && git add file && @@ -186,7 +186,7 @@ test_expect_success 'rebuild repo' ' git add file && test_commit B && - git switch main && + git switch topic && test_must_fail git merge -m "M" B && echo A >file && echo B >>file && @@ -207,7 +207,7 @@ test_expect_success 'rebuild repo' ' git merge -m R -Xtheirs X && note R && - git switch main && + git switch topic && git merge -m N R && note N && @@ -221,7 +221,7 @@ test_expect_success 'rebuild repo' ' git add z && test_commit Z && - git switch main && + git switch topic && git merge -m O Z && note O && diff --git a/t/t6400-merge-df.sh b/t/t6400-merge-df.sh index 400a4cd139..f1b84617af 100755 --- a/t/t6400-merge-df.sh +++ b/t/t6400-merge-df.sh @@ -124,7 +124,7 @@ test_expect_success 'Simple merge in repo with interesting pathnames' ' git add . && git commit -m initial && - git branch main && + git branch topic && git branch other && git checkout other && @@ -132,10 +132,10 @@ test_expect_success 'Simple merge in repo with interesting pathnames' ' git add -u && git commit -m other && - git checkout main && - echo main >foo/bar/baz && + git checkout topic && + echo topic >foo/bar/baz && git add -u && - git commit -m main && + git commit -m topic && git merge other && git ls-files -s >out && diff --git a/t/t6409-merge-subtree.sh b/t/t6409-merge-subtree.sh index 793f0c8bf3..8b11e00ded 100755 --- a/t/t6409-merge-subtree.sh +++ b/t/t6409-merge-subtree.sh @@ -35,11 +35,11 @@ test_expect_success 'setup branch sub' ' test_commit foo ' -test_expect_success 'setup branch main' ' - git checkout -b main master && +test_expect_success 'setup topic branch' ' + git checkout -b topic master && git merge -s ours --no-commit --allow-unrelated-histories sub && git read-tree --prefix=dir/ -u sub && - git commit -m "initial merge of sub into main" && + git commit -m "initial merge of sub into topic" && test_path_is_file dir/foo.t && test_path_is_file hello ' @@ -49,9 +49,9 @@ test_expect_success 'update branch sub' ' test_commit bar ' -test_expect_success 'update branch main' ' - git checkout main && - git merge -s subtree sub -m "second merge of sub into main" && +test_expect_success 'update topic branch' ' + git checkout topic && + git merge -s subtree sub -m "second merge of sub into topic" && test_path_is_file dir/bar.t && test_path_is_file dir/foo.t && test_path_is_file hello diff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh index d48d211a95..a328260d42 100755 --- a/t/t6430-merge-recursive.sh +++ b/t/t6430-merge-recursive.sh @@ -663,7 +663,7 @@ test_expect_failure 'merge-recursive rename vs. rename/symlink' ' test_expect_success 'merging with triple rename across D/F conflict' ' git reset --hard HEAD && - git checkout -b main && + git checkout -b topic && git rm -rf . && echo "just a file" >sub1 && @@ -682,7 +682,7 @@ test_expect_success 'merging with triple rename across D/F conflict' ' test_tick && git commit -a -m changesimplefile && - git checkout main && + git checkout topic && git rm sub1 && git mv sub2 sub1 && test_tick &&