Re: [RFC/PATCH] git-add: Don't exclude explicitly-specified tracked files

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

 



>> First of all, as you point out 'git add foo.pdf' works where foo.pdf
>> has been explicitly ignored, while in contrast 'git add dir/file'
>> fails when file has only been indirectly ignored because it is in an
>> ignored directory.  In the former case, the user explicitly specified
>> a policy for that file.  In the later case, the policy is only
>> indirectly expressed because that file happens to be in an ignored
>> directory.
>
> Sorry, but I don't get this argument.  When the user says "everything in
> this directory is ignored", why does it make it less direct than "this
> particular file is ignored"?
In general, I view the presence of a dir entry in a .gitignore as the
user setting a default policy for files in that directory, but the
user might actually mean for there to be some exceptions to that
policy.

For example, in my personal usage, when I ignore a directory but track
some files within it, this is because I don't want to specify an
ignore for every single other file in that directory.  Also note that
negated .gitignore entries don't seem to work in this case, i.e. a
.gitignore with contents
dir
!dir/file
won't actually let file be addable again.

In contrast, when I add dir/file to a .gitignore, there is no doubt
that I want to ignore that particular file.

Does that make more sense?

Greg
--
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]