Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 271281F404 for ; Mon, 22 Jan 2018 23:13:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751096AbeAVXNM (ORCPT ); Mon, 22 Jan 2018 18:13:12 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:54581 "EHLO pb-smtp2.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751031AbeAVXNL (ORCPT ); Mon, 22 Jan 2018 18:13:11 -0500 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 03357CB935; Mon, 22 Jan 2018 18:13:11 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=Wt3rNgDtetCX +TtUSFjNR2YbBuk=; b=HMVq0cAhYRRerrJYbdnEggtNDJLfBv4e/8fYCZync1PB JeoD8afRFxTwtKFv8rEej3yORbEM2ArkgoPmEl4oQadL4gd6yVVOApkZmzHjVB7Z L8THTfp45VHxPOL6lmSQB3UYcaKhvU3fbmF6J53fo4wtKZlNqshEwuyEbCisxyQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=rxLlJy YUF9lnNG1xPZre9qa1HVPnTBqKEVPg38Y0gsF5Wz1Ct3EgYyVSiWmgqGPZEjJYf3 OgKJd5FvJZNKgd14i/QY2hV6S86QwyArnNpVa1r8TlFOi2ooAaRlGw4tTmDsrZyS jcgZqrInzBSAsStfge8uYkOUsj6pxPycHq+zA= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id EC882CB934; Mon, 22 Jan 2018 18:13:10 -0500 (EST) Received: from pobox.com (unknown [104.132.0.95]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 63AFBCB933; Mon, 22 Jan 2018 18:13:10 -0500 (EST) From: Junio C Hamano To: =?utf-8?B?Tmd1eeG7hW4gVGjDoWkgTmfhu41j?= Duy Cc: git@vger.kernel.org Subject: Re: [PATCH] format-patch: set diffstat width to 70 instead of default 80 References: <20180122123154.8301-1-pclouds@gmail.com> Date: Mon, 22 Jan 2018 15:13:09 -0800 In-Reply-To: <20180122123154.8301-1-pclouds@gmail.com> (=?utf-8?B?Ik5ndXk=?= =?utf-8?B?4buFbiBUaMOhaSBOZ+G7jWM=?= Duy"'s message of "Mon, 22 Jan 2018 19:31:54 +0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: D02DD0EC-FFC9-11E7-98FD-575F0C78B957-77302942!pb-smtp2.pobox.com Content-Transfer-Encoding: quoted-printable Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Nguy=E1=BB=85n Th=C3=A1i Ng=E1=BB=8Dc Duy writes: > Patches or cover letters generated by format-patch are meant to be > exchanged as emails, most of the time. And since it's generally agreed > that text in mails should be wrapped around 70 columns or so, make sure > these diffstat follow the convention. > > I noticed this when I quoted a diffstat line [1]. Should we do somethin= g > like this? diffstat is rarely quoted though so perhaps the stat width > should be something like 75. > > t4052 fails but I don't think it's worth fixing until it's clear if it'= s > worth doing this. I guess you meant this as an RFC/PATCH; FWIW, I personally am in favor of this change. > > [1] https://public-inbox.org/git/20180122121426.GD5980@ash/T/#u > > Signed-off-by: Nguy=E1=BB=85n Th=C3=A1i Ng=E1=BB=8Dc Duy > --- > builtin/log.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/builtin/log.c b/builtin/log.c > index 14fdf39165..6be79656c5 100644 > --- a/builtin/log.c > +++ b/builtin/log.c > @@ -1061,6 +1061,7 @@ static void make_cover_letter(struct rev_info *re= v, int use_stdout, > =20 > memcpy(&opts, &rev->diffopt, sizeof(opts)); > opts.output_format =3D DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT; > + opts.diffopt.stat_width =3D 70; > =20 > diff_setup_done(&opts); > =20 > @@ -1611,9 +1612,12 @@ int cmd_format_patch(int argc, const char **argv= , const char *prefix) > die(_("--check does not make sense")); > =20 > if (!use_patch_format && > - (!rev.diffopt.output_format || > - rev.diffopt.output_format =3D=3D DIFF_FORMAT_PATCH)) > + (!rev.diffopt.output_format || > + rev.diffopt.output_format =3D=3D DIFF_FORMAT_PATCH)) { > rev.diffopt.output_format =3D DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUM= MARY; > + if (!rev.diffopt.stat_width) > + rev.diffopt.stat_width =3D 70; > + } > =20 > /* Always generate a patch */ > rev.diffopt.output_format |=3D DIFF_FORMAT_PATCH;