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

Re: gitignore design

From
Ferry Huberts <mailings@hupie.com>
Date
Jul 29, 2011, 14:01 UTC
Message-ID
<4E32BD2C.4090508@hupie.com>
In-Reply-To
<m3tya5qm86.fsf@localhost.localdomain>
On 07/29/2011 02:57 PM, Jakub Narebski wrote:
Show 8 quoted lines
> llucianf <llucianf@gmail.com> writes:
> 
>> im sure cvs doesnt require you to remove files from repo in order to ignore
>> them. i used cvs for years and its ingonre policy is simple and effective.
>> you just put the files/patterns into ignore file and things happen aka they
>> are ignored.
> 
> _Untracked_ files are ignored.  Tracked files are not, even with CVS.
yeah llucianf, you could have checked this yourself...

the way it works now is safer: if someone by accident puts a tracked file in an ignore file then the file is still not ignored. you actually _want_ to see the file changes since you are after all tracking the file.

git takes a safe route here.

having the file ignored while it is still in the repo can lead to very very strange situation.

suppose someone puts a complicated ignore pattern in an ignore file that has a mistake in it. then 'real' files might be ignored by the pattern by git will still see the changes.

but to come back to cvs: cvs appears to do the same as git does so your complaint is unfounded.

Show 32 quoted lines
> 
>   $ echo file2.txt >>.cvsignore
>   $ echo "3 line"  >>file2.txt
> 
> Now 'cvs status' shows file as 
> 
>   File: file2.txt         Status: Locally Modified
> 
> and 'cvs diff' shows changes.
> 
> CVS 1.11.19
> 
> [And damn, how hard it was to check this in CVS as compared to
>  checking similar things with Git].
> 
>> with this very intelligent git this simple thing is not so simple. of course
>> there are workarounds (like the template example you gave) but they are
>> clumsy.
> 
> They are correct and better solutions than ignoring changes.
> 
> Ignoring changes to tracked files is much more rare than having broad
> ignore file, and tracking some files that match ignore patterns (but
> note that you must use "git add --force" to add/track ignored file).
> 
>> im just trying to understand why git ignore mechanism cant just read the
>> .gitignore file and obey to those ignore rules without asking you to do
>> fancy voodoo operations such removing those files from repo.
> 
> Please read carefully: I mentioned 'ASSUME-UNCHANGED' mechanism in
> both of my posts, haven't I?
> 
-- 
Ferry Huberts
Previous: Jakub NarebskiNext: Jakub Narebski
Message 9 of 20 in “gitignore design”
  1. llucianfJul 29, 2011
  2. Ferry HubertsJul 29, 2011
  3. llucianfJul 29, 2011
  4. Ferry HubertsJul 29, 2011
  5. llucianfJul 29, 2011
  6. Jakub NarebskiJul 29, 2011
  7. llucianfJul 29, 2011
  8. Jakub NarebskiJul 29, 2011
  9. Ferry HubertsJul 29, 2011
  10. Jakub NarebskiJul 29, 2011
  11. Johannes SixtJul 29, 2011
  12. Jakub NarebskiJul 29, 2011
  13. Johannes SixtJul 29, 2011
  14. Jakub NarebskiJul 29, 2011
  15. Nguyen Thai Ngoc DuyJul 30, 2011
  16. Piotr KrukowieckiJul 30, 2011
  17. Nguyen Thai Ngoc DuyJul 30, 2011
  18. Piotr KrukowieckiJul 30, 2011
  19. Clemens BuchacherJul 30, 2011
  20. Philip OakleyJul 29, 2011

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.