{"thread":{"id":"50812","subject":"Git excludes fails to avoid git submodule warning","startedAt":"2019-03-23T23:01:06Z","lastAt":"2019-03-24T07:58:50Z","messageCount":2,"participants":["Klaatu","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"372316","messageId":"5352115.zUM9HkL6VV@beast","threadId":"50812","inReplyTo":null,"subject":"Git excludes fails to avoid git submodule warning","fromName":"Klaatu","fromEmail":"klaatu@member.fsf.org","sentAt":"2019-03-24T18:15:29Z","receivedAt":"2019-03-23T23:01:06Z","isPatch":false,"sender":{"key":"klaatu@member.fsf.org","avatar":null},"body":"Working with Git 2.21.0 on Linux:\n\nThe git-add(1) man page says:\n\n\"The optional configuration variable core.excludesFile indicates a path to a \nfile containing patterns of file names to exclude from git-add\"\n\nBut if I do this:\n\n$ echo \"docs/themes/*/.git >> .gitexcludes\n$ git config core.excludeFiles .gitexcludes\n$ git add docs\n warning: adding embedded git repository: docs/themes/foo\n\nIt seems to me that this goes against what the git-add(1) man page says.\n\nA workaround I found on stackoverflow is to add any file within the target \ndirectory:\n\n$ git add docs/themes/foo/README\n\nAnd then add everything:\n\n$ git add docs\n\nIn which case the contents of .gitexcludes is honoured. But that seems like a \nhack.\n\nAm I experiencing the intended result of Git's exclude function? If so, I'll \nhappily submit a patch to the man page to clarify this behaviour. If not, I \nguess I'm submitting a bug report here.\n\nThanks for all the amazing work.\n\nCheers.\n\n \n"},{"id":"372323","messageId":"CACsJy8Dhio4C6p-ZtJ1ZOq-6UP9GiBg3sXsy4YDKamm5p-zqbw@mail.gmail.com","threadId":"50812","inReplyTo":"5352115.zUM9HkL6VV@beast","subject":"Re: Git excludes fails to avoid git submodule warning","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2019-03-24T07:58:22Z","receivedAt":"2019-03-24T07:58:50Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sun, Mar 24, 2019 at 6:01 AM Klaatu <klaatu@member.fsf.org> wrote:\n>\n> Working with Git 2.21.0 on Linux:\n>\n> The git-add(1) man page says:\n>\n> \"The optional configuration variable core.excludesFile indicates a path to a\n> file containing patterns of file names to exclude from git-add\"\n>\n> But if I do this:\n>\n> $ echo \"docs/themes/*/.git >> .gitexcludes\n> $ git config core.excludeFiles .gitexcludes\n> $ git add docs\n>  warning: adding embedded git repository: docs/themes/foo\n>\n> It seems to me that this goes against what the git-add(1) man page says.\n>\n> A workaround I found on stackoverflow is to add any file within the target\n> directory:\n>\n> $ git add docs/themes/foo/README\n>\n> And then add everything:\n>\n> $ git add docs\n>\n> In which case the contents of .gitexcludes is honoured. But that seems like a\n> hack.\n\nThat's because you're not supposed to add files inside another\nrepository. The \"git add docs/theme/foo/README\" should have failed.\n\nThis kind of sharing part of worktree between two repositories (the\ntop dir and one in docs/themes/foo) has never been officiaily\nsupported if I remember it correctly.\n\n> Am I experiencing the intended result of Git's exclude function? If so, I'll\n> happily submit a patch to the man page to clarify this behaviour. If not, I\n> guess I'm submitting a bug report here.\n>\n> Thanks for all the amazing work.\n-- \nDuy\n"}]}