git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] check-ignore: clarify treatment of tracked files

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Dec 8, 2014, 16:13 UTC
Message-ID
<5485CE14.3080207@drmicha.warpmail.net>
In-Reply-To
<xmqqzjb3rx1u.fsf@gitster.dls.corp.google.com>
Junio C Hamano schrieb am 04.12.2014 um 21:15:
Show 23 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> By default, check-ignore does not list tracked files at all since
>> they are not subject to ignore patterns.
>>
>> Make this clearer in the man page.
>>
>> Reported-by: Guilherme <guibufolo@gmail.com>
>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
>> ---
>> That really is a bit confusing. Does this help?
> 
> Thanks.
> 
> "git check-ignore" is a tool to debug your .gitignore settings when
> your expectation does not match the reality, so having this new
> sentence here is a good thing to do, but I wonder if there is a more
> prominent and central place where people learn about the ignore
> mechanism the first place.  If we had this sentence there, too, that
> may reduce the need to debug their .gitignore settings in the first
> place.
> 
> Perhaps Documentation/gitignore.txt?  Documentation/user-manual.txt?
gitignore.txt has
DESCRIPTION
       A gitignore file specifies intentionally untracked files that Git
should ignore. Files already tracked by Git are not affected; see the
       NOTES below for details.
I doesn't get any clearer. But then the notes read:
NOTES
       The purpose of gitignore files is to ensure that certain files
not tracked by Git remain untracked.
       To ignore uncommitted changes in a file that is already tracked,
use git update-index --assume-unchanged.
       To stop tracking a file that is currently tracked, use git rm
--cached.

That is again clear for our case (line 1), but line 2 is troublesome, isn't it?

user-manual mainly refers to gitignore. So I guess it's good, but that line about assume-unchanged doesn't quite match with the discussion in another current thread.

Michael
Previous: Junio C Hamano
Message 7 of 7 in “git add <single file> and git add <list of files> behave differentely for ignored files”
  1. GuilhermeDec 4, 2014
  2. Konstantin KhomoutovDec 4, 2014
  3. GuilhermeDec 4, 2014
  4. Michael J GruberDec 4, 2014
  5. check-ignore: clarify treatment of tracked filesMichael J Gruber, Dec 4, 2014
  6. Junio C HamanoDec 4, 2014
  7. Michael J GruberDec 8, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.