{"thread":{"id":"54347","subject":"[PATCH] docs: clarify git rm --cached function in gitignore note","startedAt":"2020-10-05T08:59:02Z","lastAt":"2023-05-07T01:36:30Z","messageCount":7,"participants":["Sohom Datta via GitGitGadget","Sohom","Elijah Newren","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"406923","messageId":"pull.862.git.git.1601888338644.gitgitgadget@gmail.com","threadId":"54347","inReplyTo":null,"subject":"[PATCH] docs: clarify git rm --cached function in gitignore note","fromName":"Sohom Datta via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-10-05T08:58:58Z","receivedAt":"2020-10-05T08:59:02Z","isPatch":true,"sender":{"key":"name:Sohom Datta","avatar":null},"body":"From: Sohom <sohom.datta@learner.manipal.edu>\n\nAdded text explaining that the git rm --cached command\nisn't analogous to the gitignore file and that the file\nwill need to be added to gitignore to prevent later\ncommits from adding the file back.\n\nSigned-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>\n---\n    docs: Clarify git rm --cached function in gitignore note\n    \n    Added text explaining that the git rm --cached command isn't analogous\n    to the gitignore file and that the file will need to be added to \n    gitignore to prevent later commits from adding the file back.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-862%2Fsohomdatta1%2Fgitignore-note-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-862/sohomdatta1/gitignore-note-v1\nPull-Request: https://github.com/git/git/pull/862\n\n Documentation/gitignore.txt | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex d47b1ae296..22d58df805 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -147,7 +147,9 @@ The purpose of gitignore files is to ensure that certain files\n not tracked by Git remain untracked.\n \n To stop tracking a file that is currently tracked, use\n-'git rm --cached'.\n+'git rm --cached' to remove the file from the index. The filename\n+can then be added to the `gitignore` file to stop the file from\n+being reintroduced in later commits.\n \n EXAMPLES\n --------\n\nbase-commit: ab4691b67bc1a2cd8d9068fb03e3fbd6979247d6\n-- \ngitgitgadget\n"},{"id":"476479","messageId":"20230503000932.153612-1-sohomdatta1+git@gmail.com","threadId":"54347","inReplyTo":"pull.862.git.git.1601888338644.gitgitgadget@gmail.com","subject":"Re: [PATCH] docs: clarify git rm --cached function in gitignore note","fromName":"Sohom","fromEmail":"sohomdatta1@gmail.com","sentAt":"2023-05-03T00:09:32Z","receivedAt":"2023-05-03T00:09:40Z","isPatch":true,"sender":{"key":"sohomdatta1@gmail.com","avatar":null},"body":"Hey maintainers,\n\nFriendly ping regarding this patch (I assume it slipped through the cracks).\n\nIt would be great if the change could be made to the git documentation, since\nit still is a common misconception amongst students that merely adding a file\nto .gitignore will lead to the file being automagically ignored by git when that\nis in fact not the case.\n\nP.S: sohomdatta1+git@gmail.com and sohom.datta@learner.manipal.edu are both me,\nthat email was used by me previously when I was affiliated to my university.\n\nRegards,\nSohom Datta.\n"},{"id":"476487","messageId":"CABPp-BH8Mw=Fi8heF9C9g3M-wX+FyAB8FzVR58ck2zxgrdHqbw@mail.gmail.com","threadId":"54347","inReplyTo":"20230503000932.153612-1-sohomdatta1+git@gmail.com","subject":"Re: [PATCH] docs: clarify git rm --cached function in gitignore note","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2023-05-03T04:32:12Z","receivedAt":"2023-05-03T04:32:32Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nOn Tue, May 2, 2023 at 5:33 PM Sohom <sohomdatta1@gmail.com> wrote:\n>\n> Hey maintainers,\n>\n> Friendly ping regarding this patch (I assume it slipped through the cracks).\n>\n> It would be great if the change could be made to the git documentation, since\n> it still is a common misconception amongst students that merely adding a file\n> to .gitignore will lead to the file being automagically ignored by git when that\n> is in fact not the case.\n>\n> P.S: sohomdatta1+git@gmail.com and sohom.datta@learner.manipal.edu are both me,\n> that email was used by me previously when I was affiliated to my university.\n>\n> Regards,\n> Sohom Datta.\n\nYeah, looks like it slipped through the cracks.  The documentation\nchange looks reasonable to me, though given the time that has passed,\nthe context region has changed so it no longer cleanly applies.  Could\nyou rebase it and resubmit?\n\nAlso, while rebasing, the \"isn't analogous\" part of the commit message\nfeels like it misses the mark in the explanation, and the body of the\ncommit message would be better worded in the imperative tense.\nPerhaps change the main paragraph to something like:\n\nExplain to users that the step to untrack a file will not also keep it\nuntracked in the future.\n\nWhen you resubmit, go ahead and cc me.\n"},{"id":"476512","messageId":"pull.862.v2.git.git.1683127916363.gitgitgadget@gmail.com","threadId":"54347","inReplyTo":"pull.862.git.git.1601888338644.gitgitgadget@gmail.com","subject":"[PATCH v2] docs: clarify git rm --cached function in gitignore note","fromName":"Sohom Datta via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2023-05-03T15:31:56Z","receivedAt":"2023-05-03T15:32:02Z","isPatch":true,"sender":{"key":"name:Sohom Datta","avatar":null},"body":"From: Sohom <sohom.datta@learner.manipal.edu>\n\nExplain to users that the step to untrack a file will not also keep it\nuntracked in the future.\n\nSigned-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>\n---\n    docs: Clarify git rm --cached function in gitignore note\n    \n    Added text explaining that the git rm --cached command isn't analogous\n    to the gitignore file and that the file will need to be added to\n    gitignore to prevent later commits from adding the file back.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-862%2Fsohomdatta1%2Fgitignore-note-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-862/sohomdatta1/gitignore-note-v2\nPull-Request: https://github.com/git/git/pull/862\n\nRange-diff vs v1:\n\n 1:  053e9f99c9e ! 1:  c3257398c8f docs: clarify git rm --cached function in gitignore note\n     @@ Metadata\n       ## Commit message ##\n          docs: clarify git rm --cached function in gitignore note\n      \n     -    Added text explaining that the git rm --cached command\n     -    isn't analogous to the gitignore file and that the file\n     -    will need to be added to gitignore to prevent later\n     -    commits from adding the file back.\n     +    Explain to users that the step to untrack a file will not also keep it\n     +    untracked in the future.\n      \n          Signed-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>\n      \n     @@ Documentation/gitignore.txt: The purpose of gitignore files is to ensure that ce\n      +can then be added to the `gitignore` file to stop the file from\n      +being reintroduced in later commits.\n       \n     - EXAMPLES\n     - --------\n     + Git does not follow symbolic links when accessing a `.gitignore` file in\n     + the working tree. This keeps behavior consistent when the file is\n\n\n Documentation/gitignore.txt | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex f2738b10db6..8b78e1b3e08 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -146,7 +146,9 @@ The purpose of gitignore files is to ensure that certain files\n not tracked by Git remain untracked.\n \n To stop tracking a file that is currently tracked, use\n-'git rm --cached'.\n+'git rm --cached' to remove the file from the index. The filename\n+can then be added to the `gitignore` file to stop the file from\n+being reintroduced in later commits.\n \n Git does not follow symbolic links when accessing a `.gitignore` file in\n the working tree. This keeps behavior consistent when the file is\n\nbase-commit: 69c786637d7a7fe3b2b8f7d989af095f5f49c3a8\n-- \ngitgitgadget\n"},{"id":"476523","messageId":"xmqqild9tkdt.fsf@gitster.g","threadId":"54347","inReplyTo":"pull.862.v2.git.git.1683127916363.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] docs: clarify git rm --cached function in gitignore note","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-05-03T17:06:22Z","receivedAt":"2023-05-03T17:07:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Sohom Datta via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Sohom <sohom.datta@learner.manipal.edu>\n\nPlease make sure this line matches what you sign-off the patch as,\ni.e. the above line should read more like\n\n    From: Sohom Datta <sohom.datta@learner.manipal.edu>\n\n> Explain to users that the step to untrack a file will not also keep it\n> untracked in the future.\n\n\"also keep it untracked\" -> \"prevent them from getting added\"?\n\nAfter all, it is not \"git\" that makes the path tracked.  It is the\nuser who says \"git add\" that file that is not supposed to be\ntracked.\n\n> Signed-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>\n> ---\n> ...\n> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\n> index f2738b10db6..8b78e1b3e08 100644\n> --- a/Documentation/gitignore.txt\n> +++ b/Documentation/gitignore.txt\n> @@ -146,7 +146,9 @@ The purpose of gitignore files is to ensure that certain files\n>  not tracked by Git remain untracked.\n>  \n>  To stop tracking a file that is currently tracked, use\n> -'git rm --cached'.\n> +'git rm --cached' to remove the file from the index. The filename\n> +can then be added to the `gitignore` file to stop the file from\n> +being reintroduced in later commits.\n\nShould that be `.gitignore`, I have to wonder.  If the file in\nquestion is in a directory `deep/hierarchy`, the user may choose to\nadd it in `deep/hierarchy/.gitignore`, and in that sense, you may\nhave chosen to say \"tell the ignore/exclude mechanism\" in general\nwithout specifying the exact file path, in which case I am OK with\nthat strategy, too.  But then, `literal` mark-up is not appropriate\nas it is no longer something the user types literally.\n\nI'd vote for just saying `.gitignore`; it's simpler and users who\nwant to be creative can improvise at their own risk ;-)\n\nOther than that, looking good.\n\nThanks.\n\n>  Git does not follow symbolic links when accessing a `.gitignore` file in\n>  the working tree. This keeps behavior consistent when the file is\n>\n> base-commit: 69c786637d7a7fe3b2b8f7d989af095f5f49c3a8\n"},{"id":"476570","messageId":"pull.862.v3.git.git.1683150400953.gitgitgadget@gmail.com","threadId":"54347","inReplyTo":"pull.862.v2.git.git.1683127916363.gitgitgadget@gmail.com","subject":"[PATCH v3] docs: clarify git rm --cached function in gitignore note","fromName":"Sohom Datta via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2023-05-03T21:46:40Z","receivedAt":"2023-05-03T21:46:47Z","isPatch":true,"sender":{"key":"name:Sohom Datta","avatar":null},"body":"From: Sohom Datta <sohom.datta@learner.manipal.edu>\n\nExplain to users that the step to untrack a file will not also prevent them\nfrom getting added in the future.\n\nSigned-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>\n---\n    docs: Clarify git rm --cached function in gitignore note\n    \n    I've fixed the Sign-Off v/s commit author issue and incorporated the\n    changes suggested :)\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-862%2Fsohomdatta1%2Fgitignore-note-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-862/sohomdatta1/gitignore-note-v3\nPull-Request: https://github.com/git/git/pull/862\n\nRange-diff vs v2:\n\n 1:  c3257398c8f ! 1:  ae09ff2e70c docs: clarify git rm --cached function in gitignore note\n     @@\n       ## Metadata ##\n     -Author: Sohom <sohom.datta@learner.manipal.edu>\n     +Author: Sohom Datta <sohom.datta@learner.manipal.edu>\n      \n       ## Commit message ##\n          docs: clarify git rm --cached function in gitignore note\n      \n     -    Explain to users that the step to untrack a file will not also keep it\n     -    untracked in the future.\n     +    Explain to users that the step to untrack a file will not also prevent them\n     +    from getting added in the future.\n      \n          Signed-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>\n      \n     @@ Documentation/gitignore.txt: The purpose of gitignore files is to ensure that ce\n       To stop tracking a file that is currently tracked, use\n      -'git rm --cached'.\n      +'git rm --cached' to remove the file from the index. The filename\n     -+can then be added to the `gitignore` file to stop the file from\n     ++can then be added to the `.gitignore` file to stop the file from\n      +being reintroduced in later commits.\n       \n       Git does not follow symbolic links when accessing a `.gitignore` file in\n\n\n Documentation/gitignore.txt | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex f2738b10db6..4c17f2356c4 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -146,7 +146,9 @@ The purpose of gitignore files is to ensure that certain files\n not tracked by Git remain untracked.\n \n To stop tracking a file that is currently tracked, use\n-'git rm --cached'.\n+'git rm --cached' to remove the file from the index. The filename\n+can then be added to the `.gitignore` file to stop the file from\n+being reintroduced in later commits.\n \n Git does not follow symbolic links when accessing a `.gitignore` file in\n the working tree. This keeps behavior consistent when the file is\n\nbase-commit: 69c786637d7a7fe3b2b8f7d989af095f5f49c3a8\n-- \ngitgitgadget\n"},{"id":"476687","messageId":"CABPp-BEu6F1KYq8vHjypc470HH0fu-4DR6jXogAP=zY1jGNEXg@mail.gmail.com","threadId":"54347","inReplyTo":"pull.862.v3.git.git.1683150400953.gitgitgadget@gmail.com","subject":"Re: [PATCH v3] docs: clarify git rm --cached function in gitignore note","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2023-05-07T01:36:11Z","receivedAt":"2023-05-07T01:36:30Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Wed, May 3, 2023 at 2:46 PM Sohom Datta via GitGitGadget\n<gitgitgadget@gmail.com> wrote:\n>\n> From: Sohom Datta <sohom.datta@learner.manipal.edu>\n>\n> Explain to users that the step to untrack a file will not also prevent them\n> from getting added in the future.\n>\n> Signed-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>\n> ---\n>     docs: Clarify git rm --cached function in gitignore note\n>\n>     I've fixed the Sign-Off v/s commit author issue and incorporated the\n>     changes suggested :)\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-862%2Fsohomdatta1%2Fgitignore-note-v3\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-862/sohomdatta1/gitignore-note-v3\n> Pull-Request: https://github.com/git/git/pull/862\n>\n> Range-diff vs v2:\n>\n>  1:  c3257398c8f ! 1:  ae09ff2e70c docs: clarify git rm --cached function in gitignore note\n>      @@\n>        ## Metadata ##\n>      -Author: Sohom <sohom.datta@learner.manipal.edu>\n>      +Author: Sohom Datta <sohom.datta@learner.manipal.edu>\n>\n>        ## Commit message ##\n>           docs: clarify git rm --cached function in gitignore note\n>\n>      -    Explain to users that the step to untrack a file will not also keep it\n>      -    untracked in the future.\n>      +    Explain to users that the step to untrack a file will not also prevent them\n>      +    from getting added in the future.\n>\n>           Signed-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>\n>\n>      @@ Documentation/gitignore.txt: The purpose of gitignore files is to ensure that ce\n>        To stop tracking a file that is currently tracked, use\n>       -'git rm --cached'.\n>       +'git rm --cached' to remove the file from the index. The filename\n>      -+can then be added to the `gitignore` file to stop the file from\n>      ++can then be added to the `.gitignore` file to stop the file from\n>       +being reintroduced in later commits.\n>\n>        Git does not follow symbolic links when accessing a `.gitignore` file in\n>\n>\n>  Documentation/gitignore.txt | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\n> index f2738b10db6..4c17f2356c4 100644\n> --- a/Documentation/gitignore.txt\n> +++ b/Documentation/gitignore.txt\n> @@ -146,7 +146,9 @@ The purpose of gitignore files is to ensure that certain files\n>  not tracked by Git remain untracked.\n>\n>  To stop tracking a file that is currently tracked, use\n> -'git rm --cached'.\n> +'git rm --cached' to remove the file from the index. The filename\n> +can then be added to the `.gitignore` file to stop the file from\n> +being reintroduced in later commits.\n>\n>  Git does not follow symbolic links when accessing a `.gitignore` file in\n>  the working tree. This keeps behavior consistent when the file is\n>\n> base-commit: 69c786637d7a7fe3b2b8f7d989af095f5f49c3a8\n> --\n> gitgitgadget\n\nv3 looks good to me:\n\nReviewed-by: Elijah Newren <newren@gmail.com>\n"}]}