From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41C3CC433ED for ; Fri, 30 Apr 2021 19:35:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F15A6146D for ; Fri, 30 Apr 2021 19:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231280AbhD3Tfu (ORCPT ); Fri, 30 Apr 2021 15:35:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230508AbhD3Tfu (ORCPT ); Fri, 30 Apr 2021 15:35:50 -0400 Received: from mav.lukeshu.com (mav.lukeshu.com [IPv6:2001:19f0:5c00:8069:5400:ff:fe26:6a86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75E40C06174A for ; Fri, 30 Apr 2021 12:35:01 -0700 (PDT) Received: from lukeshu-dw-thinkpad (unknown [IPv6:2601:281:8200:26:4e34:88ff:fe48:5521]) by mav.lukeshu.com (Postfix) with ESMTPSA id 0B60B80590; Fri, 30 Apr 2021 15:34:47 -0400 (EDT) Date: Fri, 30 Apr 2021 13:34:46 -0600 Message-ID: <87a6pfpnvt.wl-lukeshu@lukeshu.com> From: Luke Shumaker To: Junio C Hamano Cc: Luke Shumaker , git@vger.kernel.org, Elijah Newren , Jeff King , Johannes Schindelin , =?UTF-8?B?Tmd1eeG7hW4g?= =?ISO-8859-1?Q?Th?= =?ISO-8859-1?Q?=E1i_?= =?UTF-8?B?Tmfhu41j?= Duy , Taylor Blau , "brian m . carlson" , Eric Sunshine , Luke Shumaker Subject: Re: [PATCH v3 3/3] fast-export, fast-import: implement signed-commits In-Reply-To: References: <20210422002749.2413359-1-lukeshu@lukeshu.com> <20210423164118.693197-1-lukeshu@lukeshu.com> <20210423164118.693197-4-lukeshu@lukeshu.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, 27 Apr 2021 22:02:47 -0600, Junio C Hamano wrote: > Better yet, don't butcher the region of memory pointed by the > "message" variable the caller uses to keep reading from the > remainder of the commit object buffer with this and memmove() > below. Perhaps have the caller pass a strbuf to fill in the > signature found by this helper as another parameter, and then return > a bool "Yes, I found a sig" as its return value? Stupid question: is there a better way to append a region of bytes to a strbuf than strbuf_addf(&buf, "%.*s", (int)(str_end - str_beg), str); ? It seems weird to me to invoke the printf machinery for something so simple, but I don't see anything alternatives in strbuf.h. Am I missing something? -- Happy hacking, ~ Luke Shumaker