All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: "Jonathan Tan" <jonathantanmy@google.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	"Jakub Narębski" <jnareb@gmail.com>
Subject: Re: [PATCH v3 5/6] trailer: allow non-trailers in trailer block
Date: Mon, 17 Oct 2016 18:42:33 -0700	[thread overview]
Message-ID: <xmqq7f96sa9i.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kYLq1qA4_Qg2x5Fiu5AmGBZdozm4zk6K7LkU+uJ1LNUTw@mail.gmail.com> (Stefan Beller's message of "Mon, 17 Oct 2016 17:49:19 -0700")

Stefan Beller <sbeller@google.com> writes:

> On Fri, Oct 14, 2016 at 10:38 AM, Jonathan Tan <jonathantanmy@google.com> wrote:
>>
>>  Existing trailers are extracted from the input message by looking for
>> -a group of one or more lines that contain a colon (by default), where
>> +a group of one or more lines in which at least one line contains a
>> +colon (by default), where
>
> Please see commit
> 578e6021c0819d7be1179e05e7ce0e6fdb2a01b7
> for an example where I think this is overly broad.

Hmph.  That's a merge.

    Merge branch 'rs/c-auto-resets-attributes'

    When "%C(auto)" appears at the very beginning of the pretty format
    string, it did not need to issue the reset sequence, but it did.

    * rs/c-auto-resets-attributes:
      pretty: avoid adding reset for %C(auto) if output is empty

And neither of the two colon containing line remotely resembles how
a typical RFC-822 header is formatted.  So that may serve as a hint
to how we can tighten it without introducing false negative.

> Another made up example, that I'd want to feed
> in commit -s eventually:
>
> --8<--
> demonstrate colons in Java
>
> First paragraph is not interesting.
>
> Also if using another Language such as Java, where I point out
> Class::function() to be problematic
> --8<--
>
> This would lack the white space between the last paragraph and
> the Sign off ?
>
> So for this patch I am mostly concerned about false positives hidden
> in actual text.

Yes.  

These are exactly why I mentioned "if certian number or percentage"
in my earlier suggestion.

I think in practice, "A paragraph with at least one Signed-off-by:
line, and has no more than 3/4 of the (logical) lines that do not
resemble how a typical RFC-822 header is formatted" or something
along that line would give us a reasonable safety.  

Your Java example will fail the criteria in two ways, so we'd be
safe ;-)

  reply	other threads:[~2016-10-18  1:42 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-12  1:23 [PATCH 0/5] allow non-trailers and multiple-line trailers Jonathan Tan
2016-10-12  1:23 ` [PATCH 1/5] trailer: use singly-linked list, not doubly Jonathan Tan
2016-10-12  6:24   ` Junio C Hamano
2016-10-12 15:38   ` Christian Couder
2016-10-12 17:26     ` Jeff King
2016-10-12  1:23 ` [PATCH 2/5] trailer: streamline trailer item create and add Jonathan Tan
2016-10-12  1:23 ` [PATCH 3/5] trailer: make args have their own struct Jonathan Tan
2016-10-12  1:23 ` [PATCH 4/5] trailer: allow non-trailers in trailer block Jonathan Tan
2016-10-12  1:23 ` [PATCH 5/5] trailer: support values folded to multiple lines Jonathan Tan
2016-10-12  6:23   ` Junio C Hamano
2016-10-12 23:40 ` [PATCH v2 0/6] allow non-trailers and multiple-line trailers Jonathan Tan
2016-10-12 23:40   ` [PATCH v2 1/6] trailer: improve const correctness Jonathan Tan
2016-10-12 23:40   ` [PATCH v2 2/6] trailer: use list.h for doubly-linked list Jonathan Tan
2016-10-14 17:29     ` Jakub Narębski
2016-10-14 18:27     ` Junio C Hamano
2016-10-12 23:40   ` [PATCH v2 3/6] trailer: streamline trailer item create and add Jonathan Tan
2016-10-12 23:40   ` [PATCH v2 4/6] trailer: make args have their own struct Jonathan Tan
2016-10-12 23:40   ` [PATCH v2 5/6] trailer: allow non-trailers in trailer block Jonathan Tan
2016-10-12 23:40   ` [PATCH v2 6/6] trailer: support values folded to multiple lines Jonathan Tan
2016-10-14 17:37 ` [PATCH v3 0/6] allow non-trailers and multiple-line trailers Jonathan Tan
2016-10-14 17:37   ` [PATCH v3 1/6] trailer: improve const correctness Jonathan Tan
2016-10-17 22:49     ` Stefan Beller
2016-10-14 17:37   ` [PATCH v3 2/6] trailer: use list.h for doubly-linked list Jonathan Tan
2016-10-14 17:38   ` [PATCH v3 3/6] trailer: streamline trailer item create and add Jonathan Tan
2016-10-17 23:01     ` Stefan Beller
2016-10-14 17:38   ` [PATCH v3 4/6] trailer: make args have their own struct Jonathan Tan
2016-10-17 23:20     ` Stefan Beller
2016-10-18 16:05       ` Junio C Hamano
2016-10-14 17:38   ` [PATCH v3 5/6] trailer: allow non-trailers in trailer block Jonathan Tan
2016-10-18  0:49     ` Stefan Beller
2016-10-18  1:42       ` Junio C Hamano [this message]
2016-10-18  2:02         ` Jonathan Tan
2016-10-18 16:36           ` Junio C Hamano
2016-10-19 18:00             ` Jonathan Tan
2016-10-19 19:24               ` Junio C Hamano
2016-10-14 17:38   ` [PATCH v3 6/6] trailer: support values folded to multiple lines Jonathan Tan
2016-10-18  0:55     ` Stefan Beller
2016-10-20 21:39 ` [PATCH v4 0/8] allow non-trailers and multiple-line trailers Jonathan Tan
2016-10-20 21:39   ` [PATCH v4 1/8] trailer: improve const correctness Jonathan Tan
2016-10-20 21:39   ` [PATCH v4 2/8] trailer: use list.h for doubly-linked list Jonathan Tan
2016-10-20 21:39   ` [PATCH v4 3/8] trailer: streamline trailer item create and add Jonathan Tan
2016-10-20 21:39   ` [PATCH v4 4/8] trailer: make args have their own struct Jonathan Tan
2016-10-20 21:39   ` [PATCH v4 5/8] trailer: clarify failure modes in parse_trailer Jonathan Tan
2016-10-20 22:07     ` Stefan Beller
2016-10-20 22:14       ` Junio C Hamano
2016-10-20 22:40         ` Jonathan Tan
2016-10-20 22:45           ` Junio C Hamano
2016-10-20 22:49             ` Jonathan Tan
2016-10-21  0:18               ` Junio C Hamano
2016-10-22 13:07                 ` Christian Couder
2016-10-22 16:19                   ` Junio C Hamano
2016-10-22  9:29             ` Christian Couder
2016-10-20 22:45           ` Jonathan Tan
2016-10-20 21:39   ` [PATCH v4 6/8] trailer: allow non-trailers in trailer block Jonathan Tan
2016-10-20 21:39   ` [PATCH v4 7/8] trailer: forbid leading whitespace in trailers Jonathan Tan
2016-10-20 21:39   ` [PATCH v4 8/8] trailer: support values folded to multiple lines Jonathan Tan
2016-10-21 17:54 ` [PATCH v5 0/8] allow non-trailers and multiple-line trailers Jonathan Tan
2016-10-21 17:54   ` [PATCH v5 1/8] trailer: improve const correctness Jonathan Tan
2016-10-21 17:54   ` [PATCH v5 2/8] trailer: use list.h for doubly-linked list Jonathan Tan
2016-10-21 17:54   ` [PATCH v5 3/8] trailer: streamline trailer item create and add Jonathan Tan
2016-10-21 17:54   ` [PATCH v5 4/8] trailer: make args have their own struct Jonathan Tan
2016-10-21 17:55   ` [PATCH v5 5/8] trailer: clarify failure modes in parse_trailer Jonathan Tan
2016-10-21 17:55   ` [PATCH v5 6/8] trailer: allow non-trailers in trailer block Jonathan Tan
2016-10-21 17:55   ` [PATCH v5 7/8] trailer: forbid leading whitespace in trailers Jonathan Tan
2016-10-21 17:55   ` [PATCH v5 8/8] trailer: support values folded to multiple lines Jonathan Tan
2016-10-21 23:59   ` [PATCH v5 0/8] allow non-trailers and multiple-line trailers Junio C Hamano
2016-10-22  0:06     ` Stefan Beller

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

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

  git send-email \
    --in-reply-to=xmqq7f96sa9i.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=jonathantanmy@google.com \
    --cc=sbeller@google.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.