From patchwork Sun Sep 27 08:40:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 11801987 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D48256CA for ; Sun, 27 Sep 2020 08:40:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C73CC23998 for ; Sun, 27 Sep 2020 08:40:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730593AbgI0IkL (ORCPT ); Sun, 27 Sep 2020 04:40:11 -0400 Received: from cloud.peff.net ([104.130.231.41]:42422 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730513AbgI0IkK (ORCPT ); Sun, 27 Sep 2020 04:40:10 -0400 Received: (qmail 29195 invoked by uid 109); 27 Sep 2020 08:40:10 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sun, 27 Sep 2020 08:40:10 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 4111 invoked by uid 111); 27 Sep 2020 08:40:12 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Sun, 27 Sep 2020 04:40:12 -0400 Authentication-Results: peff.net; auth=none Date: Sun, 27 Sep 2020 04:40:09 -0400 From: Jeff King To: git@vger.kernel.org Cc: Eric Sunshine , Martin =?utf-8?b?w4VncmVu?= Subject: [PATCH v2 6/8] shortlog: rename parse_stdin_ident() Message-ID: <20200927084009.GF2465761@coredump.intra.peff.net> References: <20200927083933.GA2222823@coredump.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200927083933.GA2222823@coredump.intra.peff.net> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This function is actually useful for parsing any identity, whether from stdin or not. We'll need it for handling trailers. Signed-off-by: Jeff King --- builtin/shortlog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/shortlog.c b/builtin/shortlog.c index d2d8103dd3..e6f4faec7c 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -98,8 +98,8 @@ static void insert_one_record(struct shortlog *log, } } -static int parse_stdin_ident(struct shortlog *log, - struct strbuf *out, const char *in) +static int parse_ident(struct shortlog *log, + struct strbuf *out, const char *in) { const char *mailbuf, *namebuf; size_t namelen, maillen; @@ -156,7 +156,7 @@ static void read_from_stdin(struct shortlog *log) ; /* discard blanks */ strbuf_reset(&mapped_ident); - if (parse_stdin_ident(log, &mapped_ident, v) < 0) + if (parse_ident(log, &mapped_ident, v) < 0) continue; insert_one_record(log, mapped_ident.buf, oneline.buf);