Re: [PATCH 15/20] gitattributes doc: document multi-line userdiff patterns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 14, 2021 at 7:56 PM Ævar Arnfjörð Bjarmason
<avarab@xxxxxxxxx> wrote:
> Document the multi-line userdiff patterns and how their matching and
> the negation syntax works.
> [...]
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
> ---
> diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
> @@ -794,6 +794,23 @@ backslashes; the pattern above picks a line that begins with a
> +Multiple patterns can be supplied by seperating them with

s/seperating/separating/

> +newlines. They will be matched one at a time and are compiled as
> +separate patterns, and thus the first capture in each such pattern is
> +`$1`, see further discussion of captures below.

I found the wording "separating them with newlines" ambiguous. I
couldn't figure out if that meant that there must be a blank line
between patterns. Would it be more accurate to say merely that the
patterns must be listed one per line?

> +Patterns that begin with "!" are negated (to match a literal "!" at
> +the start of a line use e.g. "[!]"). A matching negated pattern will
> +cause the matching line to be skipped. Use it to blacklist otherwise
> +matching non-negated patterns. The last pattern must not be negated,
> +we'll error out if that's the case.

The parenthesized comment makes it difficult to follow the discussion.
Moving the comment to the end of the paragraph would make it easier to
grok:

    Patterns that begin with "!" are negated. A matching...
    ...error out if that's the case. To match a literal "!" at
    the start of a line, use "[!]".

I think, also, you want s/matching line/matched line/.

Chris's comma-splice comment also seems applicable for the last
sentence in this paragraph.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux