{"thread":{"id":"66948","subject":"[PATCH] doc: gitignore: rejoin related paragraphs","startedAt":"2026-11-28T07:14:34Z","lastAt":"2026-12-01T23:49:52Z","messageCount":4,"participants":["Matt Hunter","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"559585","messageId":"20261128071613.3386188-1-m@lfurio.us","threadId":"66948","inReplyTo":null,"subject":"[PATCH] doc: gitignore: rejoin related paragraphs","fromName":"Matt Hunter","fromEmail":"m@lfurio.us","sentAt":"2026-11-28T07:14:34Z","receivedAt":"2026-11-28T07:14:34Z","isPatch":true,"sender":{"key":"m@lfurio.us","avatar":"https://avatars.githubusercontent.com/u/14925125?v=4"},"body":"Some text has become separated from relevant context by the addition of\nanother paragraph.\n\nReorder the \"If there is a separator at the beginning or middle...\" item\nso that it is next to the \"For example...\" item that describes it.  The\npreceeding item about paths ending in \"/\" is related, however the\nexample text speaks more to the moved paragraph than this one.\n\nSigned-off-by: Matt Hunter <m@lfurio.us>\n---\n\nNoticed while looking into\n <20261106182945.1316297-1-aniketgupta3001@gmail.com> and\n <xmqqh5hx4jz3.fsf_-_@gitster.g>\n\n Documentation/gitignore.adoc | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc\nindex 7979e50f187e..662632bdefc9 100644\n--- a/Documentation/gitignore.adoc\n+++ b/Documentation/gitignore.adoc\n@@ -91,11 +91,6 @@ PATTERN FORMAT\n  - The slash \"`/`\" is used as the directory separator. Separators may\n    occur at the beginning, middle or end of the `.gitignore` search pattern.\n \n- - If there is a separator at the beginning or middle (or both) of the\n-   pattern, then the pattern is relative to the directory level of the\n-   particular `.gitignore` file itself. Otherwise the pattern may also\n-   match at any level below the `.gitignore` level.\n-\n  - Patterns read from exclude sources that are outside the working tree,\n    such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if\n    they are specified at the root of the working tree, i.e. a leading \"/\"\n@@ -105,6 +100,11 @@ PATTERN FORMAT\n    will only match directories, otherwise the pattern can match both\n    files and directories.\n \n+ - If there is a separator at the beginning or middle (or both) of the\n+   pattern, then the pattern is relative to the directory level of the\n+   particular `.gitignore` file itself. Otherwise the pattern may also\n+   match at any level below the `.gitignore` level.\n+\n  - For example, a pattern `doc/frotz/` matches `doc/frotz` directory,\n    but not `a/doc/frotz` directory; however `frotz/` matches `frotz`\n    and `a/frotz` that is a directory (all paths are relative from\n\nbase-commit: a018953688f1b10bddf91bff8747068f5f4746a4\n-- \n2.56.1.944.gfc811cc53d\n\n\n"},{"id":"559626","messageId":"xmqq4id0qlze.fsf@gitster.g","threadId":"66948","inReplyTo":"20261128071613.3386188-1-m@lfurio.us","subject":"Re: [PATCH] doc: gitignore: rejoin related paragraphs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-29T04:51:01Z","receivedAt":"2026-11-29T04:51:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matt Hunter <m@lfurio.us> writes:\n\n> Some text has become separated from relevant context by the addition\n> of another paragraph.\n\n\"Some text\" and \"another paragraph\" leave the reader guessing which\nchange caused the split, so citing commit 0f0ce07625 (doc: gitignore:\nclarify pattern base for info/exclude and core.excludesFile, 2026-03-28)\nas the culprit that tore the two connected parts apart would make the\nhistory clear.\n\n> Reorder the \"If there is a separator at the beginning or middle...\"\n> item so that it is next to the \"For example...\" item that describes\n> it.  The preceeding item about paths ending in \"/\" is related, however\n> the example text speaks more to the moved paragraph than this one.\n\n\"preceding\"?\n\nI cannot grok the \"is related, however\" part of the last sentence.\nCould you clarify?\n\n> Signed-off-by: Matt Hunter <m@lfurio.us>\n> ---\n>\n> Noticed while looking into\n>  <20261106182945.1316297-1-aniketgupta3001@gmail.com> and\n>  <xmqqh5hx4jz3.fsf_-_@gitster.g>\n>\n>  Documentation/gitignore.adoc | 10 +++++-----\n>  1 file changed, 5 insertions(+), 5 deletions(-)\n>\n> diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc\n> index 7979e50f187e..662632bdefc9 100644\n> --- a/Documentation/gitignore.adoc\n> +++ b/Documentation/gitignore.adoc\n> @@ -91,11 +91,6 @@ PATTERN FORMAT\n>   - The slash \"`/`\" is used as the directory separator. Separators may\n>     occur at the beginning, middle or end of the `.gitignore` search pattern.\n>  \n> - - If there is a separator at the beginning or middle (or both) of the\n> -   pattern, then the pattern is relative to the directory level of the\n> -   particular `.gitignore` file itself. Otherwise the pattern may also\n> -   match at any level below the `.gitignore` level.\n> -\n>   - Patterns read from exclude sources that are outside the working tree,\n>     such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if\n>     they are specified at the root of the working tree, i.e. a leading \"/\"\n> @@ -105,6 +100,11 @@ PATTERN FORMAT\n>     will only match directories, otherwise the pattern can match both\n>     files and directories.\n>  \n> + - If there is a separator at the beginning or middle (or both) of the\n> +   pattern, then the pattern is relative to the directory level of the\n> +   particular `.gitignore` file itself. Otherwise the pattern may also\n> +   match at any level below the `.gitignore` level.\n> +\n>   - For example, a pattern `doc/frotz/` matches `doc/frotz` directory,\n>     but not `a/doc/frotz` directory; however `frotz/` matches `frotz`\n>     and `a/frotz` that is a directory (all paths are relative from\n\nIn Documentation/gitignore.adoc under \"PATTERN FORMAT\", the rule for\nexclude sources outside the working tree builds directly on the\nbeginning-or-middle separator rule, because saying that a leading \"/\"\nanchors matches at the repository root presupposes that the reader\nalready knows how a leading or middle separator makes a pattern relative\nto a .gitignore directory.\n\nIn the current text, the five bullets run in this order\n\n    - The slash \"`/`\" is used as the directory separator...\n\n    - If there is a separator at the beginning or middle (or both)...\n\n    - Patterns read from exclude sources that are outside the working tree...\n\n    - If there is a separator at the end of the pattern...\n\n    - For example, a pattern `doc/frotz/` matches `doc/frotz` directory,\n      but not `a/doc/frotz` directory; however `frotz/` matches `frotz`\n      and `a/frotz` that is a directory (all paths are relative from\n      the `.gitignore` file).\n\nMoving the beginning-or-middle separator bullet down below both the\nexclude-sources bullet and the trailing-slash bullet introduces two\nproblems.\n\n - the exclude-sources bullet now appears before the document has\n   explained what a leading or middle separator does in a .gitignore\n   file.\n\n - placing the trailing-slash bullet before the beginning-or-middle\n   bullet reverses the \"beginning, middle or end\" order established by\n   the introductory bullet.\n\nInstead, moving the \"Patterns read from exclude sources that are outside\nthe working tree...\" bullet down after the \"For example...\" bullet would\nrestore the original sequence from commit 1a58bad014 (gitignore.txt:\nmake slash-rules more readable, 2019-06-04).  It would keep the intro,\nbeginning/middle rule, trailing-slash rule, and their combined example\ntogether, while placing the outside-working-tree note right after \"(all\npaths are relative from the .gitignore file)\".\n\nWouldn't that give us a better presentation, I wonder?\n\n\n\n"},{"id":"559631","messageId":"DN7KWQHLF7Q2.84SK0XQELPSU@lfurio.us","threadId":"66948","inReplyTo":"xmqq4id0qlze.fsf@gitster.g","subject":"Re: [PATCH] doc: gitignore: rejoin related paragraphs","fromName":"Matt Hunter","fromEmail":"m@lfurio.us","sentAt":"2026-11-29T09:15:01Z","receivedAt":"2026-11-29T09:15:01Z","isPatch":true,"sender":{"key":"m@lfurio.us","avatar":"https://avatars.githubusercontent.com/u/14925125?v=4"},"body":"On Sat Nov 28, 2026 at 11:51 PM EST, Junio C Hamano wrote:\n>\n> \"Some text\" and \"another paragraph\" leave the reader guessing which\n> change caused the split, so citing commit 0f0ce07625 (doc: gitignore:\n> clarify pattern base for info/exclude and core.excludesFile, 2026-03-28)\n> as the culprit that tore the two connected parts apart would make the\n> history clear.\n>\n> ...\n>\n> \"preceding\"?\n\nOops.  Yes, I'll incorporate both of these.\n\n>\n> I cannot grok the \"is related, however\" part of the last sentence.\n> Could you clarify?\n\nThis is to acknowledge that the \"for example\" bullet relates to both of\nthe \"separator at beginning or middle\" and \"separator at end\" bullets,\nbut at the same time point out that the example more obviously shows the\neffects of the former point, how slashes at the beginning or middle\nanchor the rule to the current .gitignore's directory.\n\neg: There is an example and a counter-example for that bullet.  But _both_\ncases involve a rule ending in a slash to match a directory.  There is\nnot a clarifying sentence stating that \"a pattern `doc/frotz` will not\nmatch the path `a/doc/frotz`, but it will match `doc/frotz` as a\ndirectory or non-directory\".\n\nThe wording there is a little rough, but I think you will understand.\n\n>\n> In the current text, the five bullets run in this order\n[mh: adding numbering to these bullet points, for easier referencing]\n>\n>     (1) The slash \"`/`\" is used as the directory separator...\n>\n>     (2) If there is a separator at the beginning or middle (or both)...\n>\n>     (3) Patterns read from exclude sources that are outside the working tree...\n>\n>     (4) If there is a separator at the end of the pattern...\n>\n>     (5) For example, a pattern `doc/frotz/` matches `doc/frotz` directory,\n>         but not `a/doc/frotz` directory; however `frotz/` matches `frotz`\n>         and `a/frotz` that is a directory (all paths are relative from\n>         the `.gitignore` file).\n\nIn effect, this patch changes two details about the doc:\n\n    - Move the interrupting bullet (3) out from the middle of (2), (4),\n      and (5).\n\n    - Swap the order of (2) and (4), specifically to place (2) next to\n      (5), using my above explanation as a justification.\n\nThough this has led to the problems you've pointed out:\n\n>  - the exclude-sources bullet now appears before the document has\n>    explained what a leading or middle separator does in a .gitignore\n>    file.\n\nThis makes sense, and I will fix.\n\n>  - placing the trailing-slash bullet before the beginning-or-middle\n>    bullet reverses the \"beginning, middle or end\" order established by\n>    the introductory bullet.\n\nI somehow missed that (1) establishes this order.  Your suggested change\nbelow sounds like the right way to improve things.\n\nThe thing that got me to prepare a patch in the first place was the\njarring experience of reading (5) while bullet (2) was falling out of\nprominence in my brain, due to being multiple paragraphs up at that\npoint.  Though, your suggestion should make _this_ better as well.\n\n>\n> Instead, moving the \"Patterns read from exclude sources that are outside\n> the working tree...\" bullet down after the \"For example...\" bullet would\n> restore the original sequence from commit 1a58bad014 (gitignore.txt:\n> make slash-rules more readable, 2019-06-04).  It would keep the intro,\n> beginning/middle rule, trailing-slash rule, and their combined example\n> together, while placing the outside-working-tree note right after \"(all\n> paths are relative from the .gitignore file)\".\n\n"},{"id":"559844","messageId":"20261201235723.1920134-1-m@lfurio.us","threadId":"66948","inReplyTo":"20261128071613.3386188-1-m@lfurio.us","subject":"[PATCH v2] doc: gitignore: rejoin related paragraphs","fromName":"Matt Hunter","fromEmail":"m@lfurio.us","sentAt":"2026-12-01T23:49:52Z","receivedAt":"2026-12-01T23:49:52Z","isPatch":true,"sender":{"key":"m@lfurio.us","avatar":"https://avatars.githubusercontent.com/u/14925125?v=4"},"body":"Commit 0f0ce0762503 (doc: gitignore: clarify pattern base for\ninfo/exclude and core.excludesFile, 2026-03-28) added an explanation for\ninterpreting patterns found in ignore files outside the working tree.\n\nThis bullet is somewhat complementary to the preceding one.  A reader\nmay use them to better understand when patterns are interpreted relative\nto the repository root.  However, by inserting the bullet here, it\nbreaks up a sequence of a few more-closely related ones, added in\n1a58bad0144d (gitignore.txt: make slash-rules more readable,\n2019-06-04).\n\nMove this bullet down below the \"For example...\" text, to restore the\noriginal sequence from 1a58bad0144d while keeping the bullet after the\n\n    \"If there is a separator at the beginning or middle (or both)...\"\n\ntext that it builds from.\n\nSigned-off-by: Matt Hunter <m@lfurio.us>\n---\n\n Changes in v2:\n  - Only move the \"exclude sources\" bullet (below the example), and\n    preserve the original order from commit 1a58bad0144d\n  - Link to v1: https://patch.msgid.link/20261128071613.3386188-1-m@lfurio.us\n\n Documentation/gitignore.adoc | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc\nindex 7979e50f187e..a4f32f76acc9 100644\n--- a/Documentation/gitignore.adoc\n+++ b/Documentation/gitignore.adoc\n@@ -96,11 +96,6 @@ PATTERN FORMAT\n    particular `.gitignore` file itself. Otherwise the pattern may also\n    match at any level below the `.gitignore` level.\n \n- - Patterns read from exclude sources that are outside the working tree,\n-   such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if\n-   they are specified at the root of the working tree, i.e. a leading \"/\"\n-   in such patterns anchors the match at the root of the repository.\n-\n  - If there is a separator at the end of the pattern then the pattern\n    will only match directories, otherwise the pattern can match both\n    files and directories.\n@@ -110,6 +105,11 @@ PATTERN FORMAT\n    and `a/frotz` that is a directory (all paths are relative from\n    the `.gitignore` file).\n \n+ - Patterns read from exclude sources that are outside the working tree,\n+   such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if\n+   they are specified at the root of the working tree, i.e. a leading \"/\"\n+   in such patterns anchors the match at the root of the repository.\n+\n  - An asterisk \"`*`\" matches anything except a slash.\n    The character \"`?`\" matches any one character except \"`/`\".\n    The range notation, e.g. `[a-zA-Z]`, can be used to match\n\nInterdiff against v1:\n  diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc\n  index 662632bdefc9..a4f32f76acc9 100644\n  --- a/Documentation/gitignore.adoc\n  +++ b/Documentation/gitignore.adoc\n  @@ -91,25 +91,25 @@ PATTERN FORMAT\n    - The slash \"`/`\" is used as the directory separator. Separators may\n      occur at the beginning, middle or end of the `.gitignore` search pattern.\n   \n  - - Patterns read from exclude sources that are outside the working tree,\n  -   such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if\n  -   they are specified at the root of the working tree, i.e. a leading \"/\"\n  -   in such patterns anchors the match at the root of the repository.\n  -\n  - - If there is a separator at the end of the pattern then the pattern\n  -   will only match directories, otherwise the pattern can match both\n  -   files and directories.\n  -\n    - If there is a separator at the beginning or middle (or both) of the\n      pattern, then the pattern is relative to the directory level of the\n      particular `.gitignore` file itself. Otherwise the pattern may also\n      match at any level below the `.gitignore` level.\n   \n  + - If there is a separator at the end of the pattern then the pattern\n  +   will only match directories, otherwise the pattern can match both\n  +   files and directories.\n  +\n    - For example, a pattern `doc/frotz/` matches `doc/frotz` directory,\n      but not `a/doc/frotz` directory; however `frotz/` matches `frotz`\n      and `a/frotz` that is a directory (all paths are relative from\n      the `.gitignore` file).\n   \n  + - Patterns read from exclude sources that are outside the working tree,\n  +   such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if\n  +   they are specified at the root of the working tree, i.e. a leading \"/\"\n  +   in such patterns anchors the match at the root of the repository.\n  +\n    - An asterisk \"`*`\" matches anything except a slash.\n      The character \"`?`\" matches any one character except \"`/`\".\n      The range notation, e.g. `[a-zA-Z]`, can be used to match\n\nbase-commit: a018953688f1b10bddf91bff8747068f5f4746a4\n-- \n2.98.0.rc0.260.g8fecd35053\n\n\n"}]}