On Fri, Oct 24, 2008 at 8:21 AM, <david@xxxxxxx> wrote: > On Thu, 23 Oct 2008, Giuseppe Bilotta wrote: > >> I decided to give the simpler GIT_DIR approach another go. >> >> The reworked Zit ( git://git.oblomov.eu/zit ) works by creating >> .file.git/ to track file's history. .file.git/info/excludes is >> initialized to the very strong '*' pattern to ensure that things such >> as git status etc only consider the actually tracked file. >> >> The obvious advantage over the previous implementation is that we >> don't rely on fragile and non-portable hardlinks. The disadvantage >> is that something really bad can happen if a command fails to obey >> GIT_DIR or GIT_WORK_TREE correctly. > > this is a very interesting approach. > > the thought that hit me as I finidhed reading this thread is that we are > very close to having the full continum of file/repository combinations > > 1. everything in the dir is part of one repository (the normal git case) > > 2. some of all of the individual files in a dir is it's own repository (the > zit case) > > 3. the in-between case where you can have multiple repositories that can > have multiple files in them. > > how hard would it be to extend zit to support case #3? > > offhand I can see it complicating the task of figuring out which repository > to use for a file, but what else? I haven't tried this yet, but I think it should be possible without much problems. The important thing to keep in mind is that the second parameter to zit (for all commands but zit init) 'only' identifies the repository, and the filename parameter is NOT passed to git. The only exceptions are zit add and git commit, and I'm having second thoughts on add. Anyway, you can always use the 'raw' version of a command to guarantee that only GIT_DIR and GIT_WORK_TREE are set, thus: $ zit rawadd somefile -f someotherfile will force-add someotherfile to somefile's repo. (Force adding is required because of the blanket exclude.) Of course, it would be interesting adding to zit the capability to do $ zit diff someotherfile to make it guess that it should use somefile's repo. This is possible with some symlinks for the git repos, probably. I'll have a look into it. -- Giuseppe "Oblomov" Bilotta -- 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