From: Junio C Hamano <gitster@pobox.com>
To: "Sohom Datta via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Elijah Newren <newren@gmail.com>,
Sohom Datta <sohomdatta1@gmail.com>,
Sohom <sohom.datta@learner.manipal.edu>
Subject: Re: [PATCH v2] docs: clarify git rm --cached function in gitignore note
Date: Wed, 03 May 2023 10:06:22 -0700 [thread overview]
Message-ID: <xmqqild9tkdt.fsf@gitster.g> (raw)
In-Reply-To: <pull.862.v2.git.git.1683127916363.gitgitgadget@gmail.com> (Sohom Datta via GitGitGadget's message of "Wed, 03 May 2023 15:31:56 +0000")
"Sohom Datta via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Sohom <sohom.datta@learner.manipal.edu>
Please make sure this line matches what you sign-off the patch as,
i.e. the above line should read more like
From: Sohom Datta <sohom.datta@learner.manipal.edu>
> Explain to users that the step to untrack a file will not also keep it
> untracked in the future.
"also keep it untracked" -> "prevent them from getting added"?
After all, it is not "git" that makes the path tracked. It is the
user who says "git add" that file that is not supposed to be
tracked.
> Signed-off-by: Sohom Datta <sohom.datta@learner.manipal.edu>
> ---
> ...
> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
> index f2738b10db6..8b78e1b3e08 100644
> --- a/Documentation/gitignore.txt
> +++ b/Documentation/gitignore.txt
> @@ -146,7 +146,9 @@ The purpose of gitignore files is to ensure that certain files
> not tracked by Git remain untracked.
>
> To stop tracking a file that is currently tracked, use
> -'git rm --cached'.
> +'git rm --cached' to remove the file from the index. The filename
> +can then be added to the `gitignore` file to stop the file from
> +being reintroduced in later commits.
Should that be `.gitignore`, I have to wonder. If the file in
question is in a directory `deep/hierarchy`, the user may choose to
add it in `deep/hierarchy/.gitignore`, and in that sense, you may
have chosen to say "tell the ignore/exclude mechanism" in general
without specifying the exact file path, in which case I am OK with
that strategy, too. But then, `literal` mark-up is not appropriate
as it is no longer something the user types literally.
I'd vote for just saying `.gitignore`; it's simpler and users who
want to be creative can improvise at their own risk ;-)
Other than that, looking good.
Thanks.
> Git does not follow symbolic links when accessing a `.gitignore` file in
> the working tree. This keeps behavior consistent when the file is
>
> base-commit: 69c786637d7a7fe3b2b8f7d989af095f5f49c3a8
next prev parent reply other threads:[~2023-05-03 17:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-05 8:58 [PATCH] docs: clarify git rm --cached function in gitignore note Sohom Datta via GitGitGadget
2023-05-03 0:09 ` Sohom
2023-05-03 4:32 ` Elijah Newren
2023-05-03 15:31 ` [PATCH v2] " Sohom Datta via GitGitGadget
2023-05-03 17:06 ` Junio C Hamano [this message]
2023-05-03 21:46 ` [PATCH v3] " Sohom Datta via GitGitGadget
2023-05-07 1:36 ` Elijah Newren
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=xmqqild9tkdt.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=newren@gmail.com \
--cc=sohom.datta@learner.manipal.edu \
--cc=sohomdatta1@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).