{"thread":{"id":"45309","subject":"Re: git init --separate-git-dir does not update symbolic .git links for submodules","startedAt":"2017-03-07T20:08:25Z","lastAt":"2017-03-07T20:12:28Z","messageCount":2,"participants":["Valery Tolstov","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"313444","messageId":"1488916365.8812.1@smtp.yandex.ru","threadId":"45309","inReplyTo":null,"subject":"Re: git init --separate-git-dir does not update symbolic .git links for submodules","fromName":"Valery Tolstov","fromEmail":"me@vtolstov.org","sentAt":"2017-03-07T19:52:45Z","receivedAt":"2017-03-07T20:08:25Z","isPatch":false,"sender":{"key":"me@vtolstov.org","avatar":"https://avatars.githubusercontent.com/u/1188278?v=4"},"body":"Just noticed that there already is function that gives module list\nmodule_list_compute. But purpose of it's arguments is not quite clear\nfor me at this moment.\n\n"},{"id":"313446","messageId":"CAGZ79kaFxN+0W8HDBB4Wnqy64UmdsRCCF2kZ852XsLNP=QNofA@mail.gmail.com","threadId":"45309","inReplyTo":"1488916365.8812.1@smtp.yandex.ru","subject":"Re: git init --separate-git-dir does not update symbolic .git links for submodules","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-03-07T20:11:26Z","receivedAt":"2017-03-07T20:12:28Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, Mar 7, 2017 at 11:52 AM, Valery Tolstov <me@vtolstov.org> wrote:\n> Just noticed that there already is function that gives module list\n> module_list_compute. But purpose of it's arguments is not quite clear\n> for me at this moment.\n>\n\nstatic int module_list_compute(int argc, const char **argv,\n                               const char *prefix,\n                               struct pathspec *pathspec,\n                               struct module_list *list)\n\n\nargc, argv and prefix are just passed through from each caller\nargc is the number of arguments on the command line,\nargv is an array of said arguments on the command line,\nprefix is the position inside the repository.\n\ne.g. If in git.git in Documentation/, you run a git command\n\"git submodule--helper module_list *\"\nthen first \"git\" and \"submodule--helper\" are removed,\nand then cmd_submodule__helper is called (at the end of\nthe submodule helper, which then sees\n    argc=2, argv=[\"module_list\", \"*\"],\n    prefix=\"Documentation/\"\nwhich then proceeds to into module_list().\n\nThat parses these arguments, but there is no\nargument it knows about, so it does nothing.\n\nThen it just passes these three (argc, argv, prefix)\nto module_list_compute, which then makes up the list,\nto be stored in the last parameter 'list'.\n\nThe 'pathspec' parameter seems weird.\nInternally the arguments mentioned above are converted to a pathspec,\nsuch that we can go through all files and call match_pathspec inside\nof module_list_compute.\n\nIn all but one cases we do not care about the pathspec, but in one\ncase (in update_clone) we want to issue a warning if the pathspec\nwas empty (i.e. the user just said \"git submodule--helper update_clone\"\nwith no further path arguments)\n"}]}