On Wed, 18 Jul 2007, David Kastrup wrote:Yes, but directories really are different. First off, git wouldn't track the permissions anyway (git tracks execute bits, but for directories that _has_ to be set or git couldn't use them itself, so that's not going to happen). Second, and much more important, the directories will exist or not *regardless* of what git does. Bzzt. Wrong. We *do* remove directories when all files under them go away. HOWEVER (and this is where one of the reasons for not tracking them comes in): ** YOU CANNOT REMOVE A DIRECTORY IF IT HAS SOME UNTRACKED CONTENTS ** Think about that for five seconds, then think about it some more. Ponder it. So the fact is, git *already* does ass good of a job as it could possibly do wrt directories that go away: it tries to remove them if all the files that are tracked in it have gone away. But that leaves a very common case, namely switching to another branch without those files, and the directory still having stale object files etc build crud in it. A SCM *must*not* just remove that directory. It would be horrible. The fact that it has untracked files in it does not make those untracked files "unimportant". Maybe you feel that way about object files, but what about tracking some important parts of your home directory - does the fact that you don't necessarily track *all* of it mean that the rest is totally unimportant adn that git should just remove it? HELL NO! So directories really _are_ problematic. You cannot (and should not) track them the same way as you track a file. And the difference is very fundamental indeed: when you track a regular file, you track *all* of its content. But when you track a directory, you don't track it's content *at*all*. Think about that, and then think about the fact that git is defined as a "content tracker", and it's not "weasely" at all to say that you don't track directories. So your argument is totally bogus. When you track an empty file, you very much track the *content* of that file, and "empty" just happens to be a very valid content. But when you track a "directory", you don't actually track its content at all, you track it's *existence*, which is a very very very different thing. I hope you understand from the above what is so different. (A true "directory content" tracker by definition would have to track every single file under that directory. You can claim that for the case of an empty directory the "existence tracking" is 100% equivalent with "content tracking", but that's simply not true. It becomes non-true the moment there are any files at all inside that directory, and be honest now: the only _point_ of an empty directory is that you expect it to potentially get files under it). So "existence" != "content". Git very much does not track "existence" of files, it tracks the total content of them too. Linus - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| Kok, Auke | Re: Linux 2.6.21-rc1 |
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jeff Garzik | Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
git: | |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Eric Dumazet | [PATCH] net: remove superfluous call to synchronize_net() |
