{"thread":{"id":"9070","subject":"gitignore and shared worktrees (was: finding the right remote branch for a commit)","startedAt":"2007-07-17T13:09:36Z","lastAt":"2007-08-17T22:21:08Z","messageCount":3,"participants":["martin f krafft","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47630","messageId":"20070717130936.GA19724@piper.oerlikon.madduck.net","threadId":"9070","inReplyTo":null,"subject":"gitignore and shared worktrees (was: finding the right remote branch for a commit)","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-07-17T13:09:36Z","receivedAt":"2007-07-17T13:09:36Z","isPatch":false,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"Sorry for the somewhat late reply, I just found time on the weekend\nto check out this suggestion by Johannes\n\n  (http://marc.info/?l=git&m=118418927823760&w=2)\n\nalso sprach Johannes Schindelin <Johannes.Schindelin@gmx.de> [2007.07.11.2126 +0200]:\n> Come to think of it, this is maybe what I would have done, but it\n> appears to me that this is the _ideal_ use case for worktree:\n> \n> In $HOME/gits:\n> \n> $ mkdir vim.git && cd vim.git\n> $ git --work-tree=$HOME init\n> $ cat >> info/exclude < EOF\n> *\n> !/.vimrc\n> EOF\n> \n> Then you could do all Git operations like push, fetch, pull, log in \n> $HOME/gits/vim.git, and all editing in $HOME.\n\nThis actually seems to work really nicely, but I am somewhat\ndispleased by the gitignore/exclude handling, since it's local. What\nI want to do is synchronise the vim configuration across many\nworkstations with git, and I don't want to have to modify\n$GIT_DIR/info/exclude on each machine.\n\nSo I am tempted to use .gitignore, but that lives in the worktree,\nand since the suggestion is to share worktrees between different git\nrepos, I can only ever have one .gitignore file, which would have to\nlist ignores for *all* repos in $HOME/gits, which breaks my head.\n\nDo you have any other idea on how to handle ignores? I guess one\nalternative is just to ignore git status output altogether, but\nthat's not really nice.\n\nWould people consider honoring .gitignore-* in addition to just\n.gitignore? Or maybe even honouring .gitignore/*, if .gitignore is\na directory, not a file?\n\nCheers,\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \nspamtraps: madduck.bogus@madduck.net\n \n\"i like .net for the same reason i like gentoo. it keeps all the\n people with no clue from writing c code, which is much harder for me\n to identify and eliminate from my systems. in the same way that\n gentoo gives those people a place to be that isn't in debian\"\n                                                    -- andrew suffield\n"},{"id":"50873","messageId":"20070816102225.GA5351@piper.oerlikon.madduck.net","threadId":"9070","inReplyTo":"20070717130936.GA19724@piper.oerlikon.madduck.net","subject":"gitignore and shared worktrees (resend)","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-08-16T10:22:25Z","receivedAt":"2007-08-16T10:22:25Z","isPatch":false,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"I sent the following message a month ago to the mailing list and\nnever got a reply. Just to make sure it didn't simply get\noverlooked, I am reposting.\n\nBasically the issue is with using multiple git repos all sharing the\nsame worktree, and that I cannot come up with a sensible way to\nmaintain the .gitignore file such that it is part of the repo (and\nthus exists in other clones as well).\n\nI found that one can actually add and commit $GIT_DIR/info/exclude to\na repo (quite possibly a bug), but the checkout fails without -f, so\nthis is not really an option.\n\nI could set core.excludesfile to some unique name, but that again is\nnot saved in the repository and requires manual intervention after\ncloning.\n\nI still like best the suggestion to honour .gitignore/* in case\n.gitignore is a directory instead of a file. Would people be\ninterested in a patch for this?\n\n----- Forwarded message from martin f krafft <madduck@madduck.net> -----\n\nDate: Tue, 17 Jul 2007 15:09:36 +0200\nFrom: martin f krafft <madduck@madduck.net>\nTo: git@vger.kernel.org\nCc: Johannes Schindelin <Johannes.Schindelin@gmx.de>\nSubject: gitignore and shared worktrees (was: finding the right remote\n\tbranch for a commit)\nMessage-ID: <20070717130936.GA19724@piper.oerlikon.madduck.net>\n\nSorry for the somewhat late reply, I just found time on the weekend\nto check out this suggestion by Johannes\n\n  (http://marc.info/?l=git&m=118418927823760&w=2)\n\nalso sprach Johannes Schindelin <Johannes.Schindelin@gmx.de> [2007.07.11.2126 +0200]:\n> Come to think of it, this is maybe what I would have done, but it\n> appears to me that this is the _ideal_ use case for worktree:\n> \n> In $HOME/gits:\n> \n> $ mkdir vim.git && cd vim.git\n> $ git --work-tree=$HOME init\n> $ cat >> info/exclude < EOF\n> *\n> !/.vimrc\n> EOF\n> \n> Then you could do all Git operations like push, fetch, pull, log in \n> $HOME/gits/vim.git, and all editing in $HOME.\n\nThis actually seems to work really nicely, but I am somewhat\ndispleased by the gitignore/exclude handling, since it's local. What\nI want to do is synchronise the vim configuration across many\nworkstations with git, and I don't want to have to modify\n$GIT_DIR/info/exclude on each machine.\n\nSo I am tempted to use .gitignore, but that lives in the worktree,\nand since the suggestion is to share worktrees between different git\nrepos, I can only ever have one .gitignore file, which would have to\nlist ignores for *all* repos in $HOME/gits, which breaks my head.\n\nDo you have any other idea on how to handle ignores? I guess one\nalternative is just to ignore git status output altogether, but\nthat's not really nice.\n\nWould people consider honoring .gitignore-* in addition to just\n.gitignore? Or maybe even honouring .gitignore/*, if .gitignore is\na directory, not a file?\n\nCheers,\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \nfashions have done more harm than revolutions.\n                                                        -- victor hugo\n \nspamtraps: madduck.bogus@madduck.net\n"},{"id":"50964","messageId":"Pine.LNX.4.64.0708172320380.20400@racer.site","threadId":"9070","inReplyTo":"20070816102225.GA5351@piper.oerlikon.madduck.net","subject":"Re: gitignore and shared worktrees (resend)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-17T22:21:08Z","receivedAt":"2007-08-17T22:21:08Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 16 Aug 2007, martin f krafft wrote:\n\n> Basically the issue is with using multiple git repos all sharing the \n> same worktree, and that I cannot come up with a sensible way to maintain \n> the .gitignore file such that it is part of the repo (and thus exists in \n> other clones as well).\n\nI saw your message, but I could not come up with a reasonable solution.\n\nCiao,\nDscho\n"}]}