From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS54825 147.75.80.0/22 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [147.75.80.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8754E1F44D for ; Sun, 21 Apr 2024 18:59:28 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=sasl header.b=AUtZImj4; dkim-atps=neutral Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 275461F212C7 for ; Sun, 21 Apr 2024 18:59:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9958B3EA73; Sun, 21 Apr 2024 18:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="AUtZImj4" Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) (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 095B5219F9 for ; Sun, 21 Apr 2024 18:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.108.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713725959; cv=none; b=eNyM3UVSvWSDxEaiNPFg6P9gK/qmS7Oc8f5sW1BgH9LR66RABw+28lLwDpoteiDwyuN4IxjAGBzVrvYYsMu+taFJ6k9ED5hQR1Uc5dCpLwulUU5VUraa5uRLODSg39hJPqQ2fHhPQJjiJTp4hNEw8dZXyzJAl8huNxnS3DvWAfU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713725959; c=relaxed/simple; bh=LbbQq3piD6dnhpYKEqEYHxtiuyiTfdYci0NG3X+aOhI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ntu1ORF1Ra6ZVE3OqRGpXPCIyVCiML/ilstRrbLtgou6DN819SSOR+QQcj2p/0VfhWKx2O0dQxuefdmkaqm697aRUxKOyCGGDikTApFTb2JorU3SeA2du7SoXNj9rwsCX2F9g68Jdc2fep81GwwX2DWdMSjHaMZqzdc7e0Hime4= 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 (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b=AUtZImj4; arc=none smtp.client-ip=64.147.108.71 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 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id F013F1E19B0; Sun, 21 Apr 2024 14:59:16 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=LbbQq3piD6dnhpYKEqEYHxtiu yiTfdYci0NG3X+aOhI=; b=AUtZImj4M7b3Asj+pOQLV7aTtaXzdVo89gibYmpop qtYRZ5A2fWJ7AtxOavUzsw6TnxRKVLYP3VyL1NBhocfrDlHCkUuz8N5ll+yjNbem aaJIRn7W1A3pXEM2eJBjz90hXOrHe577pLRkg5c3OdfR58vOgXWncWhyXHtPGddD DE= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id E81461E19AF; Sun, 21 Apr 2024 14:59:16 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [34.125.120.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 4F0A41E19AE; Sun, 21 Apr 2024 14:59:16 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Cc: Phillip Wood , Dragan Simic Subject: [PATCH v3 0/2] format-patch --rfc=WIP Date: Sun, 21 Apr 2024 11:59:13 -0700 Message-ID: <20240421185915.1031590-1-gitster@pobox.com> X-Mailer: git-send-email 2.45.0-rc0 In-Reply-To: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Pobox-Relay-ID: 4034AD72-0011-11EF-BF40-25B3960A682E-77302942!pb-smtp2.pobox.com Content-Transfer-Encoding: quoted-printable So here is the hopefully final round. I think the first one is good, but the second one is of dubious and possibly negative value (for the reasons, see its proposed log message), so I am undecided. Junio C Hamano (2): format-patch: allow --rfc to optionally take a value, like --rfc=3DWIP format-patch: "--rfc=3D-(WIP)" appends to produce [PATCH (WIP)] Documentation/git-format-patch.txt | 19 ++++++++++++++----- builtin/log.c | 25 +++++++++++++++++++++---- t/t4014-format-patch.sh | 28 +++++++++++++++++++++++++++- 3 files changed, 62 insertions(+), 10 deletions(-) Range-diff against v2: 1: bffe0055d0 ! 1: a874b85cb5 format-patch: allow --rfc to optionally t= ake a value, like --rfc=3DWIP @@ builtin/log.c: static int subject_prefix_callback(const struct opt= ion *opt, cons +static int rfc_callback(const struct option *opt, const char *arg, + int unset) +{ -+ struct strbuf *rfc; ++ const char **rfc =3D opt->value; + -+ rfc =3D opt->value; -+ strbuf_reset(rfc); ++ *rfc =3D opt->value; + if (!unset) -+ strbuf_addstr(rfc, arg ? arg : "RFC"); ++ *rfc =3D arg ? arg : "RFC"; + return 0; +} + @@ builtin/log.c: int cmd_format_patch(int argc, const char **argv, c= onst char *pre struct strbuf rdiff2 =3D STRBUF_INIT; struct strbuf rdiff_title =3D STRBUF_INIT; struct strbuf sprefix =3D STRBUF_INIT; -+ struct strbuf rfc =3D STRBUF_INIT; ++ const char *rfc =3D NULL; int creation_factor =3D -1; - int rfc =3D 0; =20 @@ builtin/log.c: int cmd_format_patch(int argc, const char **argv, c= onst char *pre N_("cover-from-description-mode"), N_("generate parts of a cover letter based on a branch's des= cription")), @@ builtin/log.c: int cmd_format_patch(int argc, const char **argv, = const char *prefix) - if (cover_from_description_arg) cover_from_description_mode =3D parse_cover_from_description(cove= r_from_description_arg); =20 -- if (rfc) + if (rfc) - strbuf_insertstr(&sprefix, 0, "RFC "); -+ if (rfc.len) -+ strbuf_insertf(&sprefix, 0, "%s ", rfc.buf); ++ strbuf_insertf(&sprefix, 0, "%s ", rfc); =20 if (reroll_count) { strbuf_addf(&sprefix, " v%s", reroll_count); -: ---------- > 2: 6b82e903b6 format-patch: "--rfc=3D-(WIP)" appends to= produce [PATCH (WIP)] --=20 2.45.0-rc0