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,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 D81EB1F4B4 for ; Tue, 22 Dec 2020 05:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725878AbgLVFUP (ORCPT ); Tue, 22 Dec 2020 00:20:15 -0500 Received: from mail-ed1-f42.google.com ([209.85.208.42]:44914 "EHLO mail-ed1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbgLVFUO (ORCPT ); Tue, 22 Dec 2020 00:20:14 -0500 Received: by mail-ed1-f42.google.com with SMTP id p22so11714464edu.11 for ; Mon, 21 Dec 2020 21:19:58 -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=bS3lnhUCwCiVaNO7m+J2XxXoK329z7OjRKl3VZfuMy4=; b=hA3lgydTHHayfMRFtjsQ1qDZBESK8ICkmaMP0DkKB6EggOn6ZhJ7xzB7NJl/nI1HNJ NClV5Ilt+g9IBx4udeoDRuz0g2KlWHV0T/IiXdb9hn0ivOZvQ0nzEPbZhk+ncJHCFfBi ttttelrJJ9p0eVeFIaATQs4NaeJ1ZSJT/cSREd9j0qamo3g1ye73y1wd6C0tIU0GUG7Y Q3Ep1VuRyZMvbm0bMKrTDpeRCOa9RebV9v8g5v3RVEny3xtc1Us9Z8dqKBT66/naX6VB zwjyoQosbydzwbNdVSMq+7oJZgS/pF8eGFToIQ1qHBn9HsLqq+NDbJkTb28ucTDkZ0xu pKPg== X-Gm-Message-State: AOAM532lyswbTJi0o+su0fDFXLUdJwYGQqwgBY7aRhsoGS54zbSQ3mX6 E69EsqPF29dacSTsjwksLsmKgaGnI5Dgcavo63YxNKwwsOE= X-Google-Smtp-Source: ABdhPJwnTGEg1SEU9ZNCgUJNqW2qWY50p8jYXNg4lNYZVIO/BvjeyYOtpwmFHKqpNqN5o33QrE33ttGPa41xdWRSMFk= X-Received: by 2002:a50:f0dc:: with SMTP id a28mr18996007edm.291.1608614372664; Mon, 21 Dec 2020 21:19:32 -0800 (PST) MIME-Version: 1.0 References: <733c674bd1901c931a8917045eb72f661872f462.1608516320.git.gitgitgadget@gmail.com> In-Reply-To: From: Eric Sunshine Date: Tue, 22 Dec 2020 00:19:21 -0500 Message-ID: Subject: Re: [PATCH v3 1/3] test-lib-functions: handle --add in test_config To: Nipunn Koorapati Cc: Junio C Hamano , Nipunn Koorapati via GitGitGadget , Git List , 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 9:25 PM Nipunn Koorapati wrote: > That being said, I suspect anyone in the future poking around with > this will have to sourcedive > through test_config and test_unconfig to make sense of it. > > I'll switch it over to the test_unconfig option on the next reroll if requested. Indeed, it's not entirely uncommon to have to dig into the test functions when writing tests. My bigger concern was someone coming along and thinking that the mixed use of test_config() and manual `git config` in the same test was a mistake, and want to fix that mistake, which would lead the person down the same rabbit hole. Explicit cleanup via test_unconfig() and consistent use of `git config` within the test, on the other hand, does not look accidental, so the reader would be less likely to want to "fix the mistake". The comment you added in the re-roll above the manual cleanup saves the reader the trouble of having to dive into the implementation of test_config(), which is a nice bonus.