From patchwork Wed Aug 5 21:51:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11702569 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 0415A1510 for ; Wed, 5 Aug 2020 21:52:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E590022CBB for ; Wed, 5 Aug 2020 21:52:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="s1/dd40A" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726569AbgHEVv7 (ORCPT ); Wed, 5 Aug 2020 17:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725969AbgHEVvx (ORCPT ); Wed, 5 Aug 2020 17:51:53 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A259FC061575 for ; Wed, 5 Aug 2020 14:51:52 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id k8so7781917wma.2 for ; Wed, 05 Aug 2020 14:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=tx+R+LPXT+fwJZibIA4ZN5AmqEODGGIiyerNaCjUIyQ=; b=s1/dd40Axp6mD8oa1SsxZa4ODrpuwEnX1sNPjrg6QPSztA736Cv1+ARFlG62itAG0v Z6/0mxEEjKJPD+2Yw7vp99StWQGjjKrwMkmsKVia72E5BIUDi8MbYYbNaY1+sycf2PXk cZcROPw5LGuoX18wXXTHqJ7lO8M24qlPv9xLaUbA6FCIirdayIzDwovr9tGWvyaJRJgi u+ZyJFTr/ALD5WotCej8lSYJKqscs51k6PJtb/C2TJrVm8uy4uRZ0RAu69hKU7DlsmBy lDf4GPPpGaMn2/jMwNK+5mNdOAdewtwj/FI0ZQKb10T3Va93DzCpCa60LgZNWsARl/1W T3YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=tx+R+LPXT+fwJZibIA4ZN5AmqEODGGIiyerNaCjUIyQ=; b=EBmDqAsL5uKn/A1XlnZL3PVVTKghmIA8YURrGWlelNhkrfC/MFrUmvlKk2pV9Xt2F9 dZmD5/iuHjgyQlod5UX9/OcvJSgIWpCegoHZsNomEXOgPYtbjRFkU0uQVMKuaQgTRPDI 5/YJ4y3x5TReKxeI3wXpqHV3qNtXS26olW1ngRoQQfdAXljdbvEgwfZ5W7KRHv62Hs9D vIVB4bzob1TAyht+KhNADLzw0GuQERmdjFSLUESLTCK9RrJAEL2xsGwMduphfTevHzcQ 9el9bVteUFI1CNa73IpO7KQhXQa7VUjhk23GNV0TLp6BDaYelx4L96Q6jgwPjeMCbnPV 8oZg== X-Gm-Message-State: AOAM5335b25ejTSStqZzn97YKPgJqj6edOBLfcgatetOsspg3n05Ax4A 6sXftY5oJTvas/X1iq4II7H+lcCY X-Google-Smtp-Source: ABdhPJxRyjvBcoACN7TIT5ZA9RbQUwx1TnFadEdDQvy/MsRj1efSC42J98RxIIvhhEOncQ06toyi6A== X-Received: by 2002:a1c:6002:: with SMTP id u2mr4933447wmb.170.1596664311260; Wed, 05 Aug 2020 14:51:51 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id j5sm4355834wmb.12.2020.08.05.14.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 14:51:50 -0700 (PDT) Message-Id: <65fee332a3819fcaaf557d4c29e414350e62c5db.1596664306.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Hariom Verma via GitGitGadget" Date: Wed, 05 Aug 2020 21:51:39 +0000 Subject: [PATCH v2 3/9] ref-filter: modify error messages in `grab_objectname()` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Hariom Verma , Hariom Verma Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Hariom Verma As we plan to use `grab_objectname()` for `tree` and `parent` atom, it's better to parameterize the error messages in the function `grab_objectname()` where "objectname" is hard coded. Mentored-by: Christian Couder Mentored-by: Heba Waly Signed-off-by: Hariom Verma --- ref-filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index d078f893ff..4183ee2797 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -372,11 +372,11 @@ static int objectname_atom_parser(const struct ref_format *format, struct used_a atom->u.objectname.option = O_LENGTH; if (strtoul_ui(arg, 10, &atom->u.objectname.length) || atom->u.objectname.length == 0) - return strbuf_addf_ret(err, -1, _("positive value expected objectname:short=%s"), arg); + return strbuf_addf_ret(err, -1, _("positive value expected '%s' in %%(%s)"), arg, atom->name); if (atom->u.objectname.length < MINIMUM_ABBREV) atom->u.objectname.length = MINIMUM_ABBREV; } else - return strbuf_addf_ret(err, -1, _("unrecognized %%(objectname) argument: %s"), arg); + return strbuf_addf_ret(err, -1, _("unrecognized argument '%s' in %%(%s)"), arg, atom->name); return 0; }