git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>, git@vger.kernel.org
Subject: Re: bug? illegal text in commit log
Date: Thu, 6 Feb 2020 18:30:06 +0100	[thread overview]
Message-ID: <e271bb17-376d-426f-61b2-86971f1cb02b@web.de> (raw)
In-Reply-To: <xmqqd0arfyw8.fsf@gitster-ct.c.googlers.com>

Am 06.02.20 um 17:45 schrieb Junio C Hamano:
> René Scharfe <l.s.r@web.de> writes:
>
>> Like a Lines: header specifying the number of lines in the commit message?
>
> The only part of the workflow that can count the number reliably is
> format-patch.  But the output of format-patch is designed to be
> edited further, and expecting users to adjust the number when they
> make such an edit is a bit too much.

I didn't think of that, but certainly did edit the output of
format-patch before myself.  I suspect the effort to update the header
would be bearable, as it doesn't need to be exactly right and is only
needs to shield the part that looks like a patch.

We could not actually use "Lines" as the name for the header, by the
way, as it's already defined to be the number of lines in the whole
email.  Mailinfo would ignored any patches sent using a MUA that adds
such headers.

Anyway, adding a header would not cover the case where someone adds
a diff manually (and without indentation).

> As nobody in the discussion seem to care any e-mail source other
> than format-patch, we may probably be able to teach mailinfo that
>
>  * the first line that
>    - begins with "diff " or "Index", or
>    - is "---" (and nothing else on the line)
>    signals that the line no longer is part of the log
>
>  * but if it finds a line that begins with "diff --git" (or
>    optionally just "diff "), do not blindly assume that is the end
>    of the log, and instead try to find the first "---" line.  If
>    there isn't any "---", then take that "diff" line the beginning
>    of the patch, but if there is, "---" is the end of the message.
>
> The latter rule is the new one.  And there is no need to change
> format-patch output.

I like this idea.  It will probably be tricky to implement, though,
as mailinfo currently goes through the input line by line and has no
easy way to look ahead.

René

  reply	other threads:[~2020-02-06 17:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04  6:14 bug? illegal text in commit log Michael S. Tsirkin
2020-02-04 21:10 ` René Scharfe
2020-02-04 21:25   ` Junio C Hamano
2020-02-06  6:34     ` Michael S. Tsirkin
2020-02-06 16:17       ` Junio C Hamano
2020-02-06 16:45   ` Junio C Hamano
2020-02-06 17:30     ` René Scharfe [this message]
2020-02-07  5:40       ` Junio C Hamano
2020-02-07 20:30         ` René Scharfe
2020-02-12  2:24           ` Jeff King
2020-02-06 23:56     ` Michael S. Tsirkin
2020-02-07 11:02     ` Pratyush Yadav
2020-02-07 20:31       ` René Scharfe
2020-02-07 21:12         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e271bb17-376d-426f-61b2-86971f1cb02b@web.de \
    --to=l.s.r@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mst@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).