Re: gitignore design

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/29/2011 02:57 PM, Jakub Narebski wrote:
> llucianf <llucianf@xxxxxxxxx> 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.

> 
>   $ 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]