{"thread":{"id":"48136","subject":"query on git submodule (ignore)","startedAt":"2018-03-25T02:21:22Z","lastAt":"2018-03-26T18:55:48Z","messageCount":4,"participants":["prashant Nidgunde","Jacob Keller","Junio C Hamano","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"342859","messageId":"CAA7Y+T3OdaSBcqPmfJcVbPTjY=VFnvx9PH-rW9utQ4mXce+S8w@mail.gmail.com","threadId":"48136","inReplyTo":null,"subject":"query on git submodule (ignore)","fromName":"prashant Nidgunde","fromEmail":"pashnidgunde@gmail.com","sentAt":"2018-03-25T02:17:52Z","receivedAt":"2018-03-25T02:21:22Z","isPatch":false,"sender":{"key":"pashnidgunde@gmail.com","avatar":null},"body":"Hello,\n\nI am new to this community ,so please ignore if I am asking anything silly.\n\nCase :\nToday when I built my submodule , and did a git status , it shows as modified.\n\nAfter reading certain suggestions on web i found out that i can ignore\nthat adding a line in .gitmodules\n\nBut, I had to add that line manually ( which could be errorprone\nbecause of typos )\n\n\nQuestion:\n    1. Is it feasible to build a feature like :\n                   git submodule \"zlib\" ignore dirty ( which will\nignore submodule zlib when its built and dirty  as it has new files in\nits directory)\n\nIf this feature is feasible , how do i know if its developed  (\nawaiting merge ) or can I build the patch ?\n\nRegards,\nPrashant\n"},{"id":"342872","messageId":"CA+P7+xp5dJUZVgFn6gK64dOMM1_3vmEJwOWb1TVZKLL7vb8JGQ@mail.gmail.com","threadId":"48136","inReplyTo":"CAA7Y+T3OdaSBcqPmfJcVbPTjY=VFnvx9PH-rW9utQ4mXce+S8w@mail.gmail.com","subject":"Re: query on git submodule (ignore)","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2018-03-25T07:10:13Z","receivedAt":"2018-03-25T07:10:39Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Sat, Mar 24, 2018 at 7:17 PM, prashant Nidgunde\n<pashnidgunde@gmail.com> wrote:\n> Hello,\n>\n> I am new to this community ,so please ignore if I am asking anything silly.\n>\n> Case :\n> Today when I built my submodule , and did a git status , it shows as modified.\n>\n> After reading certain suggestions on web i found out that i can ignore\n> that adding a line in .gitmodules\n>\n> But, I had to add that line manually ( which could be errorprone\n> because of typos )\n>\n>\n> Question:\n>     1. Is it feasible to build a feature like :\n>                    git submodule \"zlib\" ignore dirty ( which will\n> ignore submodule zlib when its built and dirty  as it has new files in\n> its directory)\n>\n> If this feature is feasible , how do i know if its developed  (\n> awaiting merge ) or can I build the patch ?\n>\n\nI don't recall such a feature, but I'm sure patches to implement\nsomething would be welcome to be reviewed! (For more information about\nsubmitting patches you could read\nhttps://github.com/git/git/blob/master/Documentation/SubmittingPatches)\n\nI think having an option to automatically write this would be useful.\nIt may already be possible to do something similar via the git config\ncommand with the -f file argument to edit the .gitmodules file (as it\nuses the gitconfig format for its contents). However, this is\ndefinitely not intuitive.\n\nYou can read the documentation for the commands using \"git help\nsubmodule\" and \"git help config\". Patches are also definitely welcome\nfor updates to the documentation if it's not clear.\n\n\nI know also that having a simpler interface to set submodules up so\nthat they are treated as unchanged would be useful as I have projects\nat $dayjob which use submodules, and this is often a complaint against\ntheir use by my co-workers (who sometimes then accidentally commit\nre-wind updates to the submodules due to inattentiveness with use of\ngit add . or git commit -a).\n\nThanks,\nJake\n"},{"id":"342899","messageId":"xmqqk1u0f6ha.fsf@gitster-ct.c.googlers.com","threadId":"48136","inReplyTo":"CAA7Y+T3OdaSBcqPmfJcVbPTjY=VFnvx9PH-rW9utQ4mXce+S8w@mail.gmail.com","subject":"Re: query on git submodule (ignore)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-03-25T16:46:41Z","receivedAt":"2018-03-25T16:46:49Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"prashant Nidgunde <pashnidgunde@gmail.com> writes:\n\n[cc: stefan, for his interest in improving 'git submodules']\n\n> Hello,\n>\n> I am new to this community ,so please ignore if I am asking anything silly.\n>\n> Case :\n> Today when I built my submodule , and did a git status , it shows as modified.\n>\n> After reading certain suggestions on web i found out that i can ignore\n> that adding a line in .gitmodules\n>\n> But, I had to add that line manually ( which could be errorprone\n> because of typos )\n>\n>\n> Question:\n>     1. Is it feasible to build a feature like :\n>                    git submodule \"zlib\" ignore dirty ( which will\n> ignore submodule zlib when its built and dirty  as it has new files in\n> its directory)\n\nHow does it prevent you from saying \n\n\tgit submodule \"glib\" ignore dirty\n\nwhen you really meant \"zlib\"?  How is the command supposed to know\nthat you did *not* mean \"glib\", which may currently not exist in the\nindex nor in the working tree yet but you are about to create, and\ndoing the \"ignore dirty\" configuration as an earlier step of\nmultiple steps to add a submodule?\n\nI personally doubt that the main issue you should be concerned about\nis feasibility.  A larger issue is how it is supposed to help, iow,\nis such a \"feature\" useful in the first place?\n\nWhenever you hear yourself say \"I have to do X manually, and I can\nmake mistakes. Can a command do it instead?\", you have to ask\nyourself: what pieces of information do you give to that command,\nand how do you ensure you do not make typos on that command line?\n\nBesides, the above syntax would not work.  What would a user do when\na submodule called \"add\" exists, for example?\n"},{"id":"343052","messageId":"CAGZ79ka4Xfx3x09VtDOM9tD68et-DFPNCcSvJhB4G_Hb-+oPew@mail.gmail.com","threadId":"48136","inReplyTo":"xmqqk1u0f6ha.fsf@gitster-ct.c.googlers.com","subject":"Re: query on git submodule (ignore)","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-03-26T18:55:31Z","receivedAt":"2018-03-26T18:55:48Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Sun, Mar 25, 2018 at 9:46 AM Junio C Hamano <gitster@pobox.com> wrote:\n\n> prashant Nidgunde <pashnidgunde@gmail.com> writes:\n\n> [cc: stefan, for his interest in improving 'git submodules']\n\n> > Hello,\n> >\n> > I am new to this community ,so please ignore if I am asking anything\nsilly.\n> >\n> > Case :\n> > Today when I built my submodule , and did a git status , it shows as\nmodified.\n> >\n> > After reading certain suggestions on web i found out that i can ignore\n> > that adding a line in .gitmodules\n> >\n> > But, I had to add that line manually ( which could be errorprone\n> > because of typos )\n> >\n> >\n> > Question:\n> >     1. Is it feasible to build a feature like :\n> >                    git submodule \"zlib\" ignore dirty ( which will\n> > ignore submodule zlib when its built and dirty  as it has new files in\n> > its directory)\n\n> How does it prevent you from saying\n\n>          git submodule \"glib\" ignore dirty\n\n> when you really meant \"zlib\"?  How is the command supposed to know\n> that you did *not* mean \"glib\", which may currently not exist in the\n> index nor in the working tree yet but you are about to create, and\n> doing the \"ignore dirty\" configuration as an earlier step of\n> multiple steps to add a submodule?\n\n> I personally doubt that the main issue you should be concerned about\n> is feasibility.  A larger issue is how it is supposed to help, iow,\n> is such a \"feature\" useful in the first place?\n\n> Whenever you hear yourself say \"I have to do X manually, and I can\n> make mistakes. Can a command do it instead?\", you have to ask\n> yourself: what pieces of information do you give to that command,\n> and how do you ensure you do not make typos on that command line?\n\n> Besides, the above syntax would not work.  What would a user do when\n> a submodule called \"add\" exists, for example?\n\nI would think this can be solved by reordering the command to be\n\n   git submodule ignore [--option-for-granularity=dirty] [-- <path-spec>]\n\nHowever for now this would be a shallow wrapper to\n\n   name=$(git submodule--helper name <one submodule path>)\n   git config submodule.$name.ignore dirty\n\nif I understand the requested feature correctly?\nInstead of coming up with each name for each submodule path\n(btw name and path are most often the same any way,\njust put it here for correctness), one could also use\n\n   git submodule foreach -- \\\n       git -C .. config submodule.$name.ignore dirty\n\nas the foreach already populates the $name variable.\n\nStefan\n"}]}