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.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, 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 5031C1F4B4 for ; Mon, 21 Dec 2020 20:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725902AbgLUUJp (ORCPT ); Mon, 21 Dec 2020 15:09:45 -0500 Received: from mail-ed1-f43.google.com ([209.85.208.43]:33102 "EHLO mail-ed1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbgLUUJp (ORCPT ); Mon, 21 Dec 2020 15:09:45 -0500 Received: by mail-ed1-f43.google.com with SMTP id j16so10814935edr.0 for ; Mon, 21 Dec 2020 12:09:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TEv4Cjm8oH/JJp3whP1YqGaVCUijJ4KMK2wkANwkLNI=; b=jTQe5V823hx/vppbfezQdZF5KuMgBmrIoaDpD6hd79eHe2WZUkhJ2zNff+Y+eLMiRr ZwKscCeIQyKuqLycbpcsgyaiNp/HW/fybFLMogrxwDLOSRy9x6OSUiElD5JMysyOTflH J4y5zLAUZTNUi+pYB2j+c6uf4rIuykomOAozXu1AJ3eXrN429plFQQ80NGsx9x/Z9leC yQQgKpqNmF/UwTIi21ptwvoUXED7aJbAVMri9ttOJBjVoRnovlPOm6wU0bxQ6ZelX+81 CPbEaZwDpwZzqygcb0SPSdKFB66vBoNj1jrB0tetXBUwEe5jhPEE/+p8uORs2/sgqrbH TQzA== X-Gm-Message-State: AOAM530LKVAYXw4y5qmQNY3iIZ9pvD4Q8TzaX87oyoGGu/u8tpASjWZ7 tVeH8H20z/lzxS7SVmwvxK8Cx8WwbvVISi2tknNGYJFGoEo= X-Google-Smtp-Source: ABdhPJzyHPXD8SS9zlU3JkZ+AKChyqMSKsYMF5924aW2igQQErYyHG7a6e1jB+AhGH7WRU5e5ukMRo/sYpN5R5puEvc= X-Received: by 2002:a05:6402:46:: with SMTP id f6mr17549521edu.163.1608581343725; Mon, 21 Dec 2020 12:09:03 -0800 (PST) MIME-Version: 1.0 References: <733c674bd1901c931a8917045eb72f661872f462.1608516320.git.gitgitgadget@gmail.com> In-Reply-To: From: Eric Sunshine Date: Mon, 21 Dec 2020 15:08:52 -0500 Message-ID: Subject: Re: [PATCH v3 1/3] test-lib-functions: handle --add in test_config To: Junio C Hamano Cc: Nipunn Koorapati via GitGitGadget , Git List , Nipunn Koorapati , Nipunn Koorapati Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Dec 21, 2020 at 2:00 PM Junio C Hamano wrote: > Eric Sunshine writes: > > Finally, as this is a one-off case, it might be simpler just to drop > > this patch altogether and open-code the cleanup in the test itself in > > patch [2/3] rather than bothering with test_config() in that > > particular case. For example: > > > > test_when_finished "test_unconfig -C two remote.one.push" && > > git config -C two --add remote.one.push : && > > test_must_fail git -C two push one && > > git config -C two --add remote.one.push ^refs/heads/master && > > git -C two push one > > That would be my preference, too. Thanks for carefully and > patiently reviewing. I forgot to mention that it likely would be a good idea to at least mention in the commit message why test_config() is not being used for that particular case. Perhaps saying something along the lines of "one test handles config cleanup manually since test_config() is not prepared to take arbitrary options such as --add" -- or something along those lines -- would be sufficient. Alternatively, an in-code comment within the test explaining the open-coding might be more helpful to people reading the code in the future.