🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.git
4 messages
4 total messages Started by Matt Hunter Sat, 28 Nov 2026 07:14
[PATCH] doc: gitignore: rejoin related paragraphs
#4021
Author: Matt Hunter
Date: Sat, 28 Nov 2026 07:14
51 lines
9679 bytes
Some text has become separated from relevant context by the addition of
another paragraph.

Reorder the "If there is a separator at the beginning or middle..." item
so that it is next to the "For example..." item that describes it.  The
preceeding item about paths ending in "/" is related, however the
example text speaks more to the moved paragraph than this one.

Signed-off-by: Matt Hunter <m@lfurio.us>
---

Noticed while looking into
 <20261106182945.1316297-1-aniketgupta3001@gmail.com> and
 <xmqqh5hx4jz3.fsf_-_@gitster.g>

 Documentation/gitignore.adoc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc
index 7979e50f187e..662632bdefc9 100644
--- a/Documentation/gitignore.adoc
+++ b/Documentation/gitignore.adoc
@@ -91,11 +91,6 @@ PATTERN FORMAT
  - The slash "`/`" is used as the directory separator. Separators may
    occur at the beginning, middle or end of the `.gitignore` search pattern.
 
- - If there is a separator at the beginning or middle (or both) of the
-   pattern, then the pattern is relative to the directory level of the
-   particular `.gitignore` file itself. Otherwise the pattern may also
-   match at any level below the `.gitignore` level.
-
  - Patterns read from exclude sources that are outside the working tree,
    such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
    they are specified at the root of the working tree, i.e. a leading "/"
@@ -105,6 +100,11 @@ PATTERN FORMAT
    will only match directories, otherwise the pattern can match both
    files and directories.
 
+ - If there is a separator at the beginning or middle (or both) of the
+   pattern, then the pattern is relative to the directory level of the
+   particular `.gitignore` file itself. Otherwise the pattern may also
+   match at any level below the `.gitignore` level.
+
  - For example, a pattern `doc/frotz/` matches `doc/frotz` directory,
    but not `a/doc/frotz` directory; however `frotz/` matches `frotz`
    and `a/frotz` that is a directory (all paths are relative from

base-commit: a018953688f1b10bddf91bff8747068f5f4746a4
-- 
2.56.1.944.gfc811cc53d
Re: [PATCH] doc: gitignore: rejoin related paragraphs
#4060
Author: Junio C Hamano
Date: Sun, 29 Nov 2026 04:51
104 lines
17069 bytes
Matt Hunter <m@lfurio.us> writes:

> Some text has become separated from relevant context by the addition
> of another paragraph.

"Some text" and "another paragraph" leave the reader guessing which
change caused the split, so citing commit 0f0ce07625 (doc: gitignore:
clarify pattern base for info/exclude and core.excludesFile, 2026-03-28)
as the culprit that tore the two connected parts apart would make the
history clear.

> Reorder the "If there is a separator at the beginning or middle..."
> item so that it is next to the "For example..." item that describes
> it.  The preceeding item about paths ending in "/" is related, however
> the example text speaks more to the moved paragraph than this one.

"preceding"?

I cannot grok the "is related, however" part of the last sentence.
Could you clarify?

> Signed-off-by: Matt Hunter <m@lfurio.us>
> ---
>
> Noticed while looking into
>  <20261106182945.1316297-1-aniketgupta3001@gmail.com> and
>  <xmqqh5hx4jz3.fsf_-_@gitster.g>
>
>  Documentation/gitignore.adoc | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc
> index 7979e50f187e..662632bdefc9 100644
> --- a/Documentation/gitignore.adoc
> +++ b/Documentation/gitignore.adoc
> @@ -91,11 +91,6 @@ PATTERN FORMAT
>   - The slash "`/`" is used as the directory separator. Separators may
>     occur at the beginning, middle or end of the `.gitignore` search pattern.
>  
> - - If there is a separator at the beginning or middle (or both) of the
> -   pattern, then the pattern is relative to the directory level of the
> -   particular `.gitignore` file itself. Otherwise the pattern may also
> -   match at any level below the `.gitignore` level.
> -
>   - Patterns read from exclude sources that are outside the working tree,
>     such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
>     they are specified at the root of the working tree, i.e. a leading "/"
> @@ -105,6 +100,11 @@ PATTERN FORMAT
>     will only match directories, otherwise the pattern can match both
>     files and directories.
>  
> + - If there is a separator at the beginning or middle (or both) of the
> +   pattern, then the pattern is relative to the directory level of the
> +   particular `.gitignore` file itself. Otherwise the pattern may also
> +   match at any level below the `.gitignore` level.
> +
>   - For example, a pattern `doc/frotz/` matches `doc/frotz` directory,
>     but not `a/doc/frotz` directory; however `frotz/` matches `frotz`
>     and `a/frotz` that is a directory (all paths are relative from

In Documentation/gitignore.adoc under "PATTERN FORMAT", the rule for
exclude sources outside the working tree builds directly on the
beginning-or-middle separator rule, because saying that a leading "/"
anchors matches at the repository root presupposes that the reader
already knows how a leading or middle separator makes a pattern relative
to a .gitignore directory.

In the current text, the five bullets run in this order

    - The slash "`/`" is used as the directory separator...

    - If there is a separator at the beginning or middle (or both)...

    - Patterns read from exclude sources that are outside the working tree...

    - If there is a separator at the end of the pattern...

    - For example, a pattern `doc/frotz/` matches `doc/frotz` directory,
      but not `a/doc/frotz` directory; however `frotz/` matches `frotz`
      and `a/frotz` that is a directory (all paths are relative from
      the `.gitignore` file).

Moving the beginning-or-middle separator bullet down below both the
exclude-sources bullet and the trailing-slash bullet introduces two
problems.

 - the exclude-sources bullet now appears before the document has
   explained what a leading or middle separator does in a .gitignore
   file.

 - placing the trailing-slash bullet before the beginning-or-middle
   bullet reverses the "beginning, middle or end" order established by
   the introductory bullet.

Instead, moving the "Patterns read from exclude sources that are outside
the working tree..." bullet down after the "For example..." bullet would
restore the original sequence from commit 1a58bad014 (gitignore.txt:
make slash-rules more readable, 2019-06-04).  It would keep the intro,
beginning/middle rule, trailing-slash rule, and their combined example
together, while placing the outside-working-tree note right after "(all
paths are relative from the .gitignore file)".

Wouldn't that give us a better presentation, I wonder?
Re: [PATCH] doc: gitignore: rejoin related paragraphs
#4065
Author: "Matt Hunter"
Date: Sun, 29 Nov 2026 09:15
88 lines
11342 bytes
On Sat Nov 28, 2026 at 11:51 PM EST, Junio C Hamano wrote:
>
> "Some text" and "another paragraph" leave the reader guessing which
> change caused the split, so citing commit 0f0ce07625 (doc: gitignore:
> clarify pattern base for info/exclude and core.excludesFile, 2026-03-28)
> as the culprit that tore the two connected parts apart would make the
> history clear.
>
> ...
>
> "preceding"?

Oops.  Yes, I'll incorporate both of these.

>
> I cannot grok the "is related, however" part of the last sentence.
> Could you clarify?

This is to acknowledge that the "for example" bullet relates to both of
the "separator at beginning or middle" and "separator at end" bullets,
but at the same time point out that the example more obviously shows the
effects of the former point, how slashes at the beginning or middle
anchor the rule to the current .gitignore's directory.

eg: There is an example and a counter-example for that bullet.  But _both_
cases involve a rule ending in a slash to match a directory.  There is
not a clarifying sentence stating that "a pattern `doc/frotz` will not
match the path `a/doc/frotz`, but it will match `doc/frotz` as a
directory or non-directory".

The wording there is a little rough, but I think you will understand.

>
> In the current text, the five bullets run in this order
[mh: adding numbering to these bullet points, for easier referencing]
>
>     (1) The slash "`/`" is used as the directory separator...
>
>     (2) If there is a separator at the beginning or middle (or both)...
>
>     (3) Patterns read from exclude sources that are outside the working tree...
>
>     (4) If there is a separator at the end of the pattern...
>
>     (5) For example, a pattern `doc/frotz/` matches `doc/frotz` directory,
>         but not `a/doc/frotz` directory; however `frotz/` matches `frotz`
>         and `a/frotz` that is a directory (all paths are relative from
>         the `.gitignore` file).

In effect, this patch changes two details about the doc:

    - Move the interrupting bullet (3) out from the middle of (2), (4),
      and (5).

    - Swap the order of (2) and (4), specifically to place (2) next to
      (5), using my above explanation as a justification.

Though this has led to the problems you've pointed out:

>  - the exclude-sources bullet now appears before the document has
>    explained what a leading or middle separator does in a .gitignore
>    file.

This makes sense, and I will fix.

>  - placing the trailing-slash bullet before the beginning-or-middle
>    bullet reverses the "beginning, middle or end" order established by
>    the introductory bullet.

I somehow missed that (1) establishes this order.  Your suggested change
below sounds like the right way to improve things.

The thing that got me to prepare a patch in the first place was the
jarring experience of reading (5) while bullet (2) was falling out of
prominence in my brain, due to being multiple paragraphs up at that
point.  Though, your suggestion should make _this_ better as well.

>
> Instead, moving the "Patterns read from exclude sources that are outside
> the working tree..." bullet down after the "For example..." bullet would
> restore the original sequence from commit 1a58bad014 (gitignore.txt:
> make slash-rules more readable, 2019-06-04).  It would keep the intro,
> beginning/middle rule, trailing-slash rule, and their combined example
> together, while placing the outside-working-tree note right after "(all
> paths are relative from the .gitignore file)".
[PATCH v2] doc: gitignore: rejoin related paragraphs
#4236
Author: Matt Hunter
Date: Tue, 01 Dec 2026 23:49
103 lines
12526 bytes
Commit 0f0ce0762503 (doc: gitignore: clarify pattern base for
info/exclude and core.excludesFile, 2026-03-28) added an explanation for
interpreting patterns found in ignore files outside the working tree.

This bullet is somewhat complementary to the preceding one.  A reader
may use them to better understand when patterns are interpreted relative
to the repository root.  However, by inserting the bullet here, it
breaks up a sequence of a few more-closely related ones, added in
1a58bad0144d (gitignore.txt: make slash-rules more readable,
2019-06-04).

Move this bullet down below the "For example..." text, to restore the
original sequence from 1a58bad0144d while keeping the bullet after the

    "If there is a separator at the beginning or middle (or both)..."

text that it builds from.

Signed-off-by: Matt Hunter <m@lfurio.us>
---

 Changes in v2:
  - Only move the "exclude sources" bullet (below the example), and
    preserve the original order from commit 1a58bad0144d
  - Link to v1: https://patch.msgid.link/20261128071613.3386188-1-m@lfurio.us

 Documentation/gitignore.adoc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc
index 7979e50f187e..a4f32f76acc9 100644
--- a/Documentation/gitignore.adoc
+++ b/Documentation/gitignore.adoc
@@ -96,11 +96,6 @@ PATTERN FORMAT
    particular `.gitignore` file itself. Otherwise the pattern may also
    match at any level below the `.gitignore` level.
 
- - Patterns read from exclude sources that are outside the working tree,
-   such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
-   they are specified at the root of the working tree, i.e. a leading "/"
-   in such patterns anchors the match at the root of the repository.
-
  - If there is a separator at the end of the pattern then the pattern
    will only match directories, otherwise the pattern can match both
    files and directories.
@@ -110,6 +105,11 @@ PATTERN FORMAT
    and `a/frotz` that is a directory (all paths are relative from
    the `.gitignore` file).
 
+ - Patterns read from exclude sources that are outside the working tree,
+   such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
+   they are specified at the root of the working tree, i.e. a leading "/"
+   in such patterns anchors the match at the root of the repository.
+
  - An asterisk "`*`" matches anything except a slash.
    The character "`?`" matches any one character except "`/`".
    The range notation, e.g. `[a-zA-Z]`, can be used to match

Interdiff against v1:
  diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc
  index 662632bdefc9..a4f32f76acc9 100644
  --- a/Documentation/gitignore.adoc
  +++ b/Documentation/gitignore.adoc
  @@ -91,25 +91,25 @@ PATTERN FORMAT
    - The slash "`/`" is used as the directory separator. Separators may
      occur at the beginning, middle or end of the `.gitignore` search pattern.
   
  - - Patterns read from exclude sources that are outside the working tree,
  -   such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
  -   they are specified at the root of the working tree, i.e. a leading "/"
  -   in such patterns anchors the match at the root of the repository.
  -
  - - If there is a separator at the end of the pattern then the pattern
  -   will only match directories, otherwise the pattern can match both
  -   files and directories.
  -
    - If there is a separator at the beginning or middle (or both) of the
      pattern, then the pattern is relative to the directory level of the
      particular `.gitignore` file itself. Otherwise the pattern may also
      match at any level below the `.gitignore` level.
   
  + - If there is a separator at the end of the pattern then the pattern
  +   will only match directories, otherwise the pattern can match both
  +   files and directories.
  +
    - For example, a pattern `doc/frotz/` matches `doc/frotz` directory,
      but not `a/doc/frotz` directory; however `frotz/` matches `frotz`
      and `a/frotz` that is a directory (all paths are relative from
      the `.gitignore` file).
   
  + - Patterns read from exclude sources that are outside the working tree,
  +   such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
  +   they are specified at the root of the working tree, i.e. a leading "/"
  +   in such patterns anchors the match at the root of the repository.
  +
    - An asterisk "`*`" matches anything except a slash.
      The character "`?`" matches any one character except "`/`".
      The range notation, e.g. `[a-zA-Z]`, can be used to match

base-commit: a018953688f1b10bddf91bff8747068f5f4746a4
-- 
2.98.0.rc0.260.g8fecd35053
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads