From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b7-smtp.messagingengine.com (fout-b7-smtp.messagingengine.com [202.12.124.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 979B137E2E6 for ; Thu, 6 Aug 2026 16:50:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.150 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786035017; cv=none; b=g3NPhnVVV5ZuN+RpUHKes8UlZkEcuN9/JxERI/+xR/vJRoHwh5znCgaPSKL8Qp3uRUoZyg0aGde4Uy/ltZeufBJ4nfxBuRF12bxXiy7iDvoa01DufEHaSyCOciA+xid5NVsSZ8scvf1LJBCG/1KbfgzwscjtArM8H9rksudki0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786035017; c=relaxed/simple; bh=3ODITlrYuL3n256PRxi/14qDYxRVcZH2eNeacwlSMts=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=nkbdE5bXodmEcA3EEkow4tx+3JhmRzWaQeWgGRmVSqsaW6eezE7EF7YYprdZ/8otJ7z/C/zHExNx3/b7N+rgbYs0RWXNdGoiofNEhokkNaYitMrqaCKn9VARbv3/1jiQ9F1zt7gxNESZydu6keA4HpG2IOsoD7XtBVc+L7SXt3k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=lbo9PA5H; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=IaUoQHIN; arc=none smtp.client-ip=202.12.124.150 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="lbo9PA5H"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="IaUoQHIN" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 36A0C1D000C6; Thu, 6 Aug 2026 12:50:06 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-02.internal (MEProxy); Thu, 06 Aug 2026 12:50:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1786035006; x=1786121406; bh=wSF63jd6/b XG3iYERs2DoI8ur9lJYUTgsKtllZn9iro=; b=lbo9PA5HPpP9xCtFaaQo2FAaWc QGd7TKT6qZD69GFO2IiJtfO/0yjPU4C5S9k32xLFLXmYMVKw4vD+qfRluXpDfIdU B9Zgdhrbe36CEPRykBA2mxvYVO8kFn4uh//nE10H3y3N3peb+bTR22AllCdZ7RyR ZfINRueWeZqJ4QqxpUuMFdpOLDqOJuZpDMdXbTYclx36V5g/Ys9cHqzGCFy+kWYj 4i5dUy4yE1pyUV5aRAlTlxkOFr7QLou8k3EWAVVAoaWbY62U1BtkzpNeRhx6r4bH ZrTPm2ZV+4KHeVu/2IfxbF+100/kWzhJ9s7xckV+cLwhTJ2S6j9sJ7z0GbYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1786035006; x=1786121406; bh=wSF63jd6/bXG3iYERs2DoI8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LQjQPo0Ove/R3kQ X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Aug 2026 12:50:05 -0400 (EDT) From: Junio C Hamano To: Tian Yuchen Cc: git@vger.kernel.org, Christian Couder , Ayush Chandekar , Olamide Caleb Bello Subject: Re: [PATCH v2 1/3] environment: simplify repository config getters In-Reply-To: <20260806092557.3951208-2-cat@malon.dev> (Tian Yuchen's message of "Thu, 6 Aug 2026 17:25:55 +0800") References: <20260805115342.3939931-1-cat@malon.dev> <20260806092557.3951208-1-cat@malon.dev> <20260806092557.3951208-2-cat@malon.dev> Date: Thu, 06 Aug 2026 09:50:04 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Tian Yuchen writes: > Drop unnecessary parentheses and NULL checks in repository config > getters. > > These getters are only used with non-NULL repositories, so the > extra checks do not match their current callers. You would need to explain why it is sensible to enforce on future callers the same rule that current callers honor, or why it is unlikely that we will gain any more callers in the future (which would justify catering only to current callers). > Mentored-by: Christian Couder > Mentored-by: Ayush Chandekar > Mentored-by: Olamide Caleb Bello > Signed-off-by: Tian Yuchen > --- > environment.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/environment.c b/environment.c > index 76ee65e62b..f5628b6758 100644 > --- a/environment.c > +++ b/environment.c > @@ -119,23 +119,23 @@ int is_bare_repository(struct repository *repo) > > int repo_protect_ntfs(struct repository *repo) > { > - return (repo && repo->initialized) ? > - repo_config_values(repo)->protect_ntfs : > - PROTECT_NTFS_DEFAULT; > + return repo->initialized > + ? repo_config_values(repo)->protect_ntfs > + : PROTECT_NTFS_DEFAULT; > } > > int repo_protect_hfs(struct repository *repo) > { > - return (repo && repo->initialized) ? > - repo_config_values(repo)->protect_hfs : > - PROTECT_HFS_DEFAULT; > + return repo->initialized > + ? repo_config_values(repo)->protect_hfs > + : PROTECT_HFS_DEFAULT; > } > > int repo_ignore_case(struct repository *repo) > { > - return (repo && repo->initialized) ? > - repo_config_values(repo)->ignore_case : > - 0; > + return repo->initialized > + ? repo_config_values(repo)->ignore_case > + : 0; > } > > int repo_trust_executable_bit(struct repository *repo)