From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id E84981F461 for ; Tue, 20 Aug 2019 03:47:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729160AbfHTDrB (ORCPT ); Mon, 19 Aug 2019 23:47:01 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38307 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728627AbfHTDrA (ORCPT ); Mon, 19 Aug 2019 23:47:00 -0400 Received: by mail-wr1-f68.google.com with SMTP id g17so10800866wrr.5 for ; Mon, 19 Aug 2019 20:46:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y9m68RxJswJ4ejui6LPKWCFyC301Q3u4bUjfyZ70Nl0=; b=qrdfZSA1/QbU/si0We6rNBGbIBxY8l+3tPpbMWaQkrslkghMehNpVTVU//3NzXPXOH jan/RWz1mBzAugM6GuIxAbhZfW6Yl/+fGbfo2P/+fccPk0MYfKid4i1JgeC106R8qeXZ bnMr2GC4jUzmmnPk3RjGuoYpDzhUhzKSeZwuu1SI69qf32ZL7/Kvv6nEJnP1bJUbPElf 8upF7Utoe4TdPMuvKxQz8AS9K81grSV2NeBIzj7vIr3GWCGEEmgUsgVZdZWX7OIP6/2B ik9Xk6bRF5CJ6psyQt3s3eomS4F9et4cL0qVwqfJnik0q+exiSOMkTfAUyGj5Pw9op7+ jvQw== X-Gm-Message-State: APjAAAV7x84zxIIuAZHL75xg+EOaQ4+eEzh6tORfWoOLmNY4wb2o5oye euSY/A5kB6W1XScE22AtRHLr3jjvL6t65TUVFKg= X-Google-Smtp-Source: APXvYqyssVfan6cS1fJjHPDEYA79+N2li0X0yeIQVFizrEeidZQnIa7PQyqljfzHtcd6BFKxrs3uGzFsvtiAkwVxNdg= X-Received: by 2002:a5d:4c87:: with SMTP id z7mr29899878wrs.10.1566272818498; Mon, 19 Aug 2019 20:46:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Sunshine Date: Mon, 19 Aug 2019 23:46:47 -0400 Message-ID: Subject: Re: [PATCH v2 4/4] format-patch: learn --infer-cover-letter option To: Denton Liu Cc: Git Mailing List , =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Junio C Hamano Content-Type: text/plain; charset="UTF-8" Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Aug 19, 2019 at 7:53 PM Denton Liu wrote: > We used to populate the subject of the cover letter generated by > git-format-patch with "*** SUBJECT HERE ***". However, if a user submits > multiple patchsets, they may want to keep a consistent subject between > rerolls. > > If git-format-patch is run with `--infer-cover-letter` or s/letter/subject/ > `format.inferCoverSubject`, infer the subject for the cover letter from > the top line(s) of a branch description, similar to how a subject is > read from a commit message. A possible rewrite of the entire commit message in imperative mood: Teach 'format-patch' to use the first line of the branch description as the Subject: of the generated cover letter, rather than "*** SUBJECT HERE ***", if --infer-cover-subject is specified (or the corresponding `format.inferCoverSubject` option is enabled). This complements existing inclusion of the branch description in the cover letter body. A casual reader of this patch might wonder why this new useful behavior isn't default, so it might make sense for the commit message to further explain that making it default would potentially break existing tooling. > Signed-off-by: Denton Liu > --- > diff --git a/Documentation/config/format.txt b/Documentation/config/format.txt > @@ -36,6 +36,10 @@ format.subjectPrefix:: > +format.inferCoverSubject:: > + A boolean value which lets you enable the > + `--infer-cover-subject` option of format-patch by default. As mentioned in my review of 3/4, it is common to mention the default value at the end of the paragraph. So, perhaps: A boolean that controls whether or not to take the first line of the branch description as the subject for the cover letter. See the `--infer-cover-subject` option in linkgit:git-format-patch[1]. Default is false. > diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt > @@ -171,6 +172,14 @@ will want to ensure that threading is disabled for `git send-email`. > +--[no-]infer-cover-subject:: > + Instead of using the default "*** SUBJECT HERE ***" subject for > + the cover letter, infer the subject from the branch's > + description. > ++ > +Similar to a commit message, the subject is inferred as the beginning of > +the description up to and excluding the first blank line. I think this can all be collapsed to the simpler: Use the beginning of the branch description (up to the first blank line) as the cover letter subject instead of the default "*** SUBJECT HERE ***". or something. > diff --git a/builtin/log.c b/builtin/log.c > @@ -1577,6 +1589,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) > + OPT_BOOL(0, "infer-cover-subject", &infer_cover_subject, > + N_("infer a cover letter subject from the branch description")), Shorter: "infer cover letter subject from branch description"