From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 E879E4FDA4A for ; Mon, 21 Sep 2026 21:18:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790025533; cv=none; b=L4K0DoCk+xkuqN1ye3ZTm0lDJqK09DIYN2/PYKkp5E3g+Crq/vxcvKqSfp9yZczBBRYftzOgTrQiPSy+xVtmjw63dYtE6+RKHEv1rIfnEZKCr5VVxeSRSbK8MAOA8JTE3jh4uXO68q0xXykmLVMbblhwmZd+PubwHUDXlilGLG0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790025533; c=relaxed/simple; bh=Dr/pgxR0nIMevo45ZoEMlCzP/LIHEE9qGTc+mwcIiKI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=DfUJkxaQeQXbHgae0h47A6lpTTh5Cw0zRxMooC6skN/KwfU1ylPxyPrO9pfYOVoRBThRPCWJ8vux/InT+Qtjc3xRVTuosM1hGnDy9G8+BnUzg0UFnAU+S+b72gV2fD3rHAi1lBGUS4IVdC7fztree1bfvdXV7Rd1YC5tqz9whP0= 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=nwjRMKH2; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=MIVbw6gL; arc=none smtp.client-ip=103.168.172.149 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="nwjRMKH2"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="MIVbw6gL" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 07FC8EC02BB; Mon, 21 Sep 2026 17:18:50 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-06.internal (MEProxy); Mon, 21 Sep 2026 17:18:50 -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=fm3; t=1790025530; x=1790111930; bh=AL/Guh6fCc gfJKqv63J5ZPHySwkF5NHUQTOQO3vivy4=; b=nwjRMKH2NK3MoZiXha0rzHmrC1 Vado5/nutc2DDsigF5oGaQLx2GnS2bSjRtkU/g3FP/R8YZB0PZaRR4npH8RATZl0 YDJIEgqAgqF0kb6q6JMue211rvcPyfT9EjW8GPW6DeAILNSDqwqskgFVW/eXnnzo ultc2D4nCjcMJuWncSyHBFfcbytIMH+NlyX0BDlaDKLTGEQSe7+KsTcLZrBYoKWw jK5y1a4BswrPwheWGNBBasaZUFp/lgb3WZ91JKbcqqEvSvtV/glZcM3RmFW7J2g2 kTQRULVmCQIsKds8Svhpqy2r6yOQKfuskWhxBlOdrnBKq8WTDkMEbkv093gA== 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=fm1; t= 1790025530; x=1790111930; bh=AL/Guh6fCcgfJKqv63J5ZP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NQf2mw01Vjlcxg X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Sep 2026 17:18:49 -0400 (EDT) From: Junio C Hamano To: "Derrick Stolee via GitGitGadget" Cc: git@vger.kernel.org, peff@peff.net, newren@gmail.com, Derrick Stolee Subject: Re: [PATCH 1/6] strbuf: add header for 'safe' API In-Reply-To: (Derrick Stolee via GitGitGadget's message of "Fri, 18 Sep 2026 13:02:15 +0000") References: Date: Mon, 21 Sep 2026 14:18:48 -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 "Derrick Stolee via GitGitGadget" writes: > +/* > + * NOTE FOR STRBUF DEVELOPERS > + * > + * strbuf is a low-level primitive; as such it should interact only > + * with other low-level primitives. Do not introduce new functions > + * which interact with higher-level APIs. > + * > + * This header file specifically conatins the "safe" API surface for > + * working with strbufs. The implementations of these methods avoid > + * using die() and other exits. Thus, these methods are appropriate > + * for use within lower-level APIs such as trace2. > + */ I have to wonder if this is somewhat backwards, in that the longer term goal for us should be to make most of the service routines like strbuf, string_list, csum_file, etc., free of die() and be "safe". A recent trend under the label "libification" is to make the use of the_repository more explicit and pass a "struct repository *" as a parameter instead more widely throughout the code flow, but it would be equally if not more useful change to expand the "safe" API surface so that callers of more service routines take responsibility to act on errors. And picking strbuf as the first instance of such generic service library certainly is a good idea. Its interface is well defined. We may want to rename functions that _happen_ to use a strbuf to return their results but otherwise has nothing to do with strbuf away from strbuf_ prefix (strbuf_realpath() etc. in abspath.h are prime examples) as part of this first step, though.