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-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 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,RCVD_IN_DNSWL_HI, 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 61C4F1F5AE for ; Mon, 10 May 2021 15:15:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239246AbhEJPQL (ORCPT ); Mon, 10 May 2021 11:16:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237229AbhEJPNq (ORCPT ); Mon, 10 May 2021 11:13:46 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA41C0515F5 for ; Mon, 10 May 2021 07:32:24 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 4-20020a05600c26c4b0290146e1feccd8so9012214wmv.1 for ; Mon, 10 May 2021 07:32:24 -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=e0AFiKuXTDrR4q0mnk0AYLo0DDiyvTsqjqWZ5xqPfbU=; b=C6KE6+/eqrVDKTBV6Jnr52btw/Nu5NQBaHtEyB0W3Va4qYq8QZZlTH4rQijpqazSk5 2h9lRXIEgYBQKpYCF9MgR+SHSx5MuvLsehku9uCq7mLIItyA3mMajpr/qkRxgSqKmanD usx9PNkVgWX/KU7oIhD+73nERJaPsjRD7nweVV21YlvEdgKHGEtOkPB9SdD1b6PdPvUP kHL14RDKRT8OgOfXtsDAD2p3kLqt+ID2FYVzzIvMagbnTHMhfsihlTEXhs7B7/pNSmg2 P7T87xeuKx99+20yRNN2aGLJP2C3pfVbhJqbt6KefkHeDc3uPFh936ibi+Z1kkIkOb4/ ISDQ== 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=e0AFiKuXTDrR4q0mnk0AYLo0DDiyvTsqjqWZ5xqPfbU=; b=W1pW9I4ckWBYYB+IHt5035sywEFEE9X/Ei70EsShO21+Ytq2czk3+7ezhFA2rNMeXx jnGzgqVEbcY2PVpvljvbpoTTxU/EPslN/Z+K0YmIKk/FywUhPtOKi9GnnYRo+1SzjrKF ZtJXVikc5ggg21tawAqeqN6DhOJX27P6E8r4HsWM1AIfjeOzReKEF9YKWwYsc+egAGue EJNi0bupI17Dk3BDG5JvxRGXizaHBvzuap89J4T/TphvSDTg0OJ47dca8CZXu7pdFMB8 gI+xUeEKWO/fGWhheYh6TmXh784rkCaSJsBFU8FkIud4IysYy1PkYGIS3UZhmh8mvksS 1AFA== X-Gm-Message-State: AOAM531w+0Ruehh0q4uDX1X+rCe+7tSoC9KhcBdrNnMmk2YqlJD9ZqEb 8gLQhRKzK9eK7isB1gYliFg9cfm/srbs5w== X-Google-Smtp-Source: ABdhPJw2N3l2MJOzEUv5TAlJBEqBS2/gQrcenoGXhYvvC8o7ln1prMueB19BVEc/vGrN8wnRPSWVRQ== X-Received: by 2002:a05:600c:9:: with SMTP id g9mr27151144wmc.134.1620657142929; Mon, 10 May 2021 07:32:22 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id q10sm22421839wre.92.2021.05.10.07.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 07:32:22 -0700 (PDT) From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Matthieu Moy , Johannes Schindelin , Eric Sunshine , =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= , =?UTF-8?q?SZEDER=20G=C3=A1bor?= , Andreas Schwab , =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Subject: [PATCH v6 10/11] test-lib: do not show advice about init.defaultBranch under --verbose Date: Mon, 10 May 2021 16:19:09 +0200 Message-Id: X-Mailer: git-send-email 2.31.1.838.g924d365b763 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Arrange for the advice about naming the initial branch not to be shown in the --verbose output of the test suite. Since 675704c74dd (init: provide useful advice about init.defaultBranch, 2020-12-11) some tests have been very chatty with repeated occurrences of this multi-line advice. Having it be this verbose isn't helpful for anyone in the context of git's own test suite, and it makes debugging tests that use their own "git init" invocations needlessly distracting. By setting the GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME variable early in test-lib.sh itself we'll squash the warning not only for test_create_repo(), as 675704c74dd explicitly intended, but also for other "git init" invocations. And once we'd like to have this configuration set for all "git init" invocations in the test suite we can get rid of the init.defaultBranch configuration setting in test_create_repo(), as repo_default_branch_name() in refs.c will take the GIT_TEST_* variable over it being set. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/test-lib-functions.sh | 1 - t/test-lib.sh | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 661597e9192..669645a812f 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -1253,7 +1253,6 @@ test_create_repo () { ( cd "$repo" || error "Cannot setup test environment" "${GIT_TEST_INSTALLED:-$GIT_EXEC_PATH}/git$X" \ - -c init.defaultBranch="${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}" \ init \ "--template=$GIT_BUILD_DIR/templates/blt/" >&3 2>&4 || error "cannot run git init -- have you built things yet?" diff --git a/t/test-lib.sh b/t/test-lib.sh index 7647afcfd0a..f3671b1766d 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -64,6 +64,11 @@ then export GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS fi +# Explicitly set the default branch name for testing, to avoid the +# transitory "git init" warning under --verbose. +: ${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME:=master} +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + ################################################################ # It appears that people try to run tests without building... "${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git$X" >/dev/null -- 2.31.1.838.g924d365b763