{"thread":{"id":"31630","subject":"[PATCH] commit: configure submodules","startedAt":"2012-09-23T07:37:47Z","lastAt":"2012-09-24T20:36:40Z","messageCount":14,"participants":["Orgad Shaneh","Junio C Hamano","Jens Lehmann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"199754","messageId":"1348385867-17359-1-git-send-email-orgads@gmail.com","threadId":"31630","inReplyTo":null,"subject":"[PATCH] commit: configure submodules","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2012-09-23T07:37:47Z","receivedAt":"2012-09-23T07:37:47Z","isPatch":true,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"As reported on the mailing list[1], ignore submodule config is not\nrespected on commit.\n\n[1] http://git.661346.n2.nabble.com/submodule-ignore-is-not-respected-on-commit-td7539238.html\n\nSigned-off-by: Orgad Shaneh <orgads@gmail.com>\n---\n builtin/commit.c |    1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 62028e7..7a83cae 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1452,6 +1452,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n \n \twt_status_prepare(&s);\n+\tgitmodules_config();\n \tgit_config(git_commit_config, &s);\n \tdetermine_whence(&s);\n \ts.colopts = 0;\n-- \n1.7.10.4\n"},{"id":"199757","messageId":"7vr4pt16ep.fsf@alter.siamese.dyndns.org","threadId":"31630","inReplyTo":"1348385867-17359-1-git-send-email-orgads@gmail.com","subject":"Re: [PATCH] commit: configure submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-23T08:37:34Z","receivedAt":"2012-09-23T08:37:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Orgad Shaneh <orgads@gmail.com> writes:\n\n> As reported on the mailing list[1], ignore submodule config is not\n> respected on commit.\n>\n> [1] http://git.661346.n2.nabble.com/submodule-ignore-is-not-respected-on-commit-td7539238.html\n>\n> Signed-off-by: Orgad Shaneh <orgads@gmail.com>\n> ---\n\nThanks.\n\nPlease do not force people to go to external website like that while\nreading the \"git log\" output.  You could have just said\n\n\t\"git status\" does not list a submodule with uncommitted\n\tworking tree files as modified when \"submodule.$name.ignore\"\n\tconfiguration is set to \"dirty\", but \"git commit\" forgets\n        to take this configuration variable into account.\n\nor something.  It would also be good to say \"I reported it earlier\nin this message\" with the URL _after_ the three-dash line.\n\nI see Jens added with 302ad7a (Submodules: Use \"ignore\" settings\nfrom .gitmodules too for diff and status, 2010-08-06) the call to\ngitmodules_config() to \"git status\" and \"git diff\" family, but I\nsuspect that was a huge mistake.  Once a submodule is initialized\nwith \"submodule init\", the default set of configuration should be\ncopied to the user's $GIT_DIR/config and subsequent run-time\ninvocation should read $GIT_DIR/config and $GIT_DIR/config alone, to\nhonor user's customization.\n\nInstead, I think git_commit_config() and git_status_config() should\ncall submodule_config() function to read submodule.$name.ignore not\nfrom .gitmodules file but from $GIT_DIR/config.\n\nJens, what do you think?  I see no reason for anybody other than\n\"submodule init\" to call gitmodules_config() that reads from the\nin-tree .gitmodules file.\n\n>  builtin/commit.c |    1 +\n>  1 file changed, 1 insertion(+)\n>\n> diff --git a/builtin/commit.c b/builtin/commit.c\n> index 62028e7..7a83cae 100644\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -1452,6 +1452,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n>  \t\tusage_with_options(builtin_commit_usage, builtin_commit_options);\n>  \n>  \twt_status_prepare(&s);\n> +\tgitmodules_config();\n>  \tgit_config(git_commit_config, &s);\n>  \tdetermine_whence(&s);\n>  \ts.colopts = 0;\n"},{"id":"199783","messageId":"505F5151.2080208@web.de","threadId":"31630","inReplyTo":"7vr4pt16ep.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] commit: configure submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-09-23T18:13:37Z","receivedAt":"2012-09-23T18:13:37Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 23.09.2012 10:37, schrieb Junio C Hamano:\n> I see Jens added with 302ad7a (Submodules: Use \"ignore\" settings\n> from .gitmodules too for diff and status, 2010-08-06) the call to\n> gitmodules_config() to \"git status\" and \"git diff\" family, but I\n> suspect that was a huge mistake.  Once a submodule is initialized\n> with \"submodule init\", the default set of configuration should be\n> copied to the user's $GIT_DIR/config and subsequent run-time\n> invocation should read $GIT_DIR/config and $GIT_DIR/config alone, to\n> honor user's customization.\n\nNot honoring the user's customization would be a big mistake, but\nthis is not what happens here. A setting in $GIT_DIR/config always\noverrides the one in .gitmodules (that's why gitmodules_config() is\ncalled before git_config()).\n\n> Instead, I think git_commit_config() and git_status_config() should\n> call submodule_config() function to read submodule.$name.ignore not\n> from .gitmodules file but from $GIT_DIR/config.\n> \n> Jens, what do you think?  I see no reason for anybody other than\n> \"submodule init\" to call gitmodules_config() that reads from the\n> in-tree .gitmodules file.\n\nI think the copying on init is not what we should do here because\nit sets the user's customization to what ever happened to be in\n.gitmodules at the time he initialized the submodule. Later changes\nfrom upstream to such a setting would not be honored unless the\nuser copies that new setting herself (which I think is The Right\nThing for the URL, but not for the other work tree related settings\nlike 'ignore').\n\nImagine you have a submodule containing a huge media file which is\nset to be ignored for performance reasons. When upstream later\ndecides it should rather use .gitattributes to just disable diffing\nthat file and removes the submodule ignore so the users see changes\nto other files of the submodule again, that will just work the way\nit is done now, but won't when we copy that setting on init.\n\nSo it is either \"honor upstream unless the user decides otherwise\"\nor \"take what upstream configured at init time as the users choice\n(until he actively changes it)\". And I think the former is more\nflexible as it allows upstream to change settings without user\nintervention, which is why I did it that way.\n\nAnd as I understand that .gitattributes follow the same principle:\nUnless the user configured something different in his\n$GIT_DIR/info/attributes file, git will use the settings from the\n.gitattributes file of the currently checked out commit.\n\nSo I think Orgad's change is sane and should go in.\n"},{"id":"199787","messageId":"7vmx0g0xpm.fsf@alter.siamese.dyndns.org","threadId":"31630","inReplyTo":"505F5151.2080208@web.de","subject":"Re: [PATCH] commit: configure submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-24T05:57:41Z","receivedAt":"2012-09-24T05:57:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jens Lehmann <Jens.Lehmann@web.de> writes:\n\n>> Jens, what do you think?  I see no reason for anybody other than\n>> \"submodule init\" to call gitmodules_config() that reads from the\n>> in-tree .gitmodules file.\n>\n> I think the copying on init is not what we should do here because\n> it sets the user's customization to what ever happened to be in\n> .gitmodules at the time he initialized the submodule.\n\nHrm, why does the user have submodule.$name.$whatever customized\nbefore saying \"submodule init $whategver\" for that copying to be\nproblematic?\n\n> So I think Orgad's change is sane and should go in.\n\nMatching what cmd_commit() does to what cmd_status() does, i.e. grab\nsubmodule.$name.ignore from somewhere, is not something I questioned.\nThe patch is a good change to make them consistent.\n\nWhat I was wondering was if that is a consistently wrong thing to do\nto read from .gitmodules not $GIT_DIR/config.\n\nIn any case, the log message I suggested in the review needs to be\nupdated in the reroll to make it clear that this is about reading\nfrom .gitmodules, not \"configuration\".  AFAICS, gitmodule_config()\ndoes not even read from $GIT_DIR/config, right?\n"},{"id":"199828","messageId":"7v39271j3n.fsf@alter.siamese.dyndns.org","threadId":"31630","inReplyTo":"7vmx0g0xpm.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] commit: configure submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-24T16:27:56Z","receivedAt":"2012-09-24T16:27:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Jens Lehmann <Jens.Lehmann@web.de> writes:\n>\n>>> Jens, what do you think?  I see no reason for anybody other than\n>>> \"submodule init\" to call gitmodules_config() that reads from the\n>>> in-tree .gitmodules file.\n>>\n>> I think the copying on init is not what we should do here because\n>> it sets the user's customization to what ever happened to be in\n>> .gitmodules at the time he initialized the submodule.\n>\n> Hrm, why does the user have submodule.$name.$whatever customized\n> before saying \"submodule init $whategver\" for that copying to be\n> problematic?\n>\n>> So I think Orgad's change is sane and should go in.\n>\n> Matching what cmd_commit() does to what cmd_status() does, i.e. grab\n> submodule.$name.ignore from somewhere, is not something I questioned.\n> The patch is a good change to make them consistent.\n>\n> What I was wondering was if that is a consistently wrong thing to do\n> to read from .gitmodules not $GIT_DIR/config.\n>\n> In any case, the log message I suggested in the review needs to be\n> updated in the reroll to make it clear that this is about reading\n> from .gitmodules, not \"configuration\".  AFAICS, gitmodule_config()\n> does not even read from $GIT_DIR/config, right?\n\nOK.  gitmodule_config() does not read $GIT_DIR/config, but\ncmd_status() and cmd_commit() call git_diff_basic_config() that is\ncalled from git_diff_ui_config() to read submodule.$name.ignore from\nit.  So Orgad's patch is _only_ about submodule.$name.ignore that is\nin in-tree .gitmodule; the log message shouldn't mention \"config\",\nas setting configuration variables work for both status and commit\njust fine.\n"},{"id":"199835","messageId":"5060A32D.1060902@web.de","threadId":"31630","inReplyTo":"7v39271j3n.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] commit: configure submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-09-24T18:15:09Z","receivedAt":"2012-09-24T18:15:09Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 24.09.2012 18:27, schrieb Junio C Hamano:\n> Junio C Hamano <gitster@pobox.com> writes:\n>> In any case, the log message I suggested in the review needs to be\n>> updated in the reroll to make it clear that this is about reading\n>> from .gitmodules, not \"configuration\".  AFAICS, gitmodule_config()\n>> does not even read from $GIT_DIR/config, right?\n> \n> OK.  gitmodule_config() does not read $GIT_DIR/config, but\n> cmd_status() and cmd_commit() call git_diff_basic_config() that is\n> called from git_diff_ui_config() to read submodule.$name.ignore from\n> it.  So Orgad's patch is _only_ about submodule.$name.ignore that is\n> in in-tree .gitmodule; the log message shouldn't mention \"config\",\n> as setting configuration variables work for both status and commit\n> just fine.\n\nYes, I was just checking that call path too to make sure the user\nsettings from $GIT_DIR/config really override those found in\n.gitmodules. And of course you are right, while the change to the\ncode is sane the commit message still needs some work.\n"},{"id":"199838","messageId":"7vlifzz2vo.fsf@alter.siamese.dyndns.org","threadId":"31630","inReplyTo":"5060A32D.1060902@web.de","subject":"Re: [PATCH] commit: configure submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-24T18:34:19Z","receivedAt":"2012-09-24T18:34:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jens Lehmann <Jens.Lehmann@web.de> writes:\n\n> Am 24.09.2012 18:27, schrieb Junio C Hamano:\n>> Junio C Hamano <gitster@pobox.com> writes:\n>>> In any case, the log message I suggested in the review needs to be\n>>> updated in the reroll to make it clear that this is about reading\n>>> from .gitmodules, not \"configuration\".  AFAICS, gitmodule_config()\n>>> does not even read from $GIT_DIR/config, right?\n>> \n>> OK.  gitmodule_config() does not read $GIT_DIR/config, but\n>> cmd_status() and cmd_commit() call git_diff_basic_config() that is\n>> called from git_diff_ui_config() to read submodule.$name.ignore from\n>> it.  So Orgad's patch is _only_ about submodule.$name.ignore that is\n>> in in-tree .gitmodule; the log message shouldn't mention \"config\",\n>> as setting configuration variables work for both status and commit\n>> just fine.\n>\n> Yes, I was just checking that call path too to make sure the user\n> settings from $GIT_DIR/config really override those found in\n> .gitmodules. And of course you are right, while the change to the\n> code is sane the commit message still needs some work.\n\nHere is what I tentatively queued on 'pu' (not pushed out yet).\n\n-- >8 --\nFrom: Orgad Shaneh <orgads@gmail.com>\nDate: Sun, 23 Sep 2012 09:37:47 +0200\nSubject: [PATCH] commit: pay attention to submodule.$name.ignore in\n .gitmodules\n\n\"git status\" does not list a submodule with uncommitted working tree\nfiles as modified when \"submodule.$name.ignore\" is set to \"dirty\" in\nin-tree \".gitmodules\" file.  Both status and commit honor the setting\nin $GIT_DIR/config, but \"commit\" does not pick it up from .gitmodules,\nwhich is inconsistent.\n\nTeach \"git commit\" to pay attention to the setting in .gitmodules as\nwell.\n\nSigned-off-by: Orgad Shaneh <orgads@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/commit.c | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 66fdd22..3cb1ef7 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1256,6 +1256,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \tstruct wt_status s;\n \n \twt_status_prepare(&s);\n+\tgitmodules_config();\n \tgit_config(git_commit_config, &s);\n \tin_merge = file_exists(git_path(\"MERGE_HEAD\"));\n \ts.in_merge = in_merge;\n-- \n1.7.12.1.441.g794a63b\n"},{"id":"199841","messageId":"CAGHpTB+F3=mW9m3ESQe1wAkLzSBcp+5Kgw1Kb-D-rk2T1q_-iw@mail.gmail.com","threadId":"31630","inReplyTo":"7vlifzz2vo.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] commit: configure submodules","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2012-09-24T18:49:23Z","receivedAt":"2012-09-24T18:49:23Z","isPatch":true,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"On Mon, Sep 24, 2012 at 8:34 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Jens Lehmann <Jens.Lehmann@web.de> writes:\n>\n> > Am 24.09.2012 18:27, schrieb Junio C Hamano:\n> >> Junio C Hamano <gitster@pobox.com> writes:\n> >>> In any case, the log message I suggested in the review needs to be\n> >>> updated in the reroll to make it clear that this is about reading\n> >>> from .gitmodules, not \"configuration\".  AFAICS, gitmodule_config()\n> >>> does not even read from $GIT_DIR/config, right?\n> >>\n> >> OK.  gitmodule_config() does not read $GIT_DIR/config, but\n> >> cmd_status() and cmd_commit() call git_diff_basic_config() that is\n> >> called from git_diff_ui_config() to read submodule.$name.ignore from\n> >> it.  So Orgad's patch is _only_ about submodule.$name.ignore that is\n> >> in in-tree .gitmodule; the log message shouldn't mention \"config\",\n> >> as setting configuration variables work for both status and commit\n> >> just fine.\n> >\n> > Yes, I was just checking that call path too to make sure the user\n> > settings from $GIT_DIR/config really override those found in\n> > .gitmodules. And of course you are right, while the change to the\n> > code is sane the commit message still needs some work.\n>\n> Here is what I tentatively queued on 'pu' (not pushed out yet).\n>\n> -- >8 --\n> From: Orgad Shaneh <orgads@gmail.com>\n> Date: Sun, 23 Sep 2012 09:37:47 +0200\n> Subject: [PATCH] commit: pay attention to submodule.$name.ignore in\n>  .gitmodules\n>\n> \"git status\" does not list a submodule with uncommitted working tree\n> files as modified when \"submodule.$name.ignore\" is set to \"dirty\" in\n> in-tree \".gitmodules\" file.  Both status and commit honor the setting\n> in $GIT_DIR/config, but \"commit\" does not pick it up from .gitmodules,\n> which is inconsistent.\n>\n> Teach \"git commit\" to pay attention to the setting in .gitmodules as\n> well.\n>\n> Signed-off-by: Orgad Shaneh <orgads@gmail.com>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  builtin/commit.c | 1 +\n>  1 file changed, 1 insertion(+)\n>\n> diff --git a/builtin/commit.c b/builtin/commit.c\n> index 66fdd22..3cb1ef7 100644\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -1256,6 +1256,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n>         struct wt_status s;\n>\n>         wt_status_prepare(&s);\n> +       gitmodules_config();\n>         git_config(git_commit_config, &s);\n>         in_merge = file_exists(git_path(\"MERGE_HEAD\"));\n>         s.in_merge = in_merge;\n> --\n> 1.7.12.1.441.g794a63b\n>\n\nThat is not correct. git-config is ignored as well for commit. Maybe\nanother fix is needed?\n\n- Orgad\n"},{"id":"199845","messageId":"7vy5jzxmts.fsf@alter.siamese.dyndns.org","threadId":"31630","inReplyTo":"CAGHpTB+F3=mW9m3ESQe1wAkLzSBcp+5Kgw1Kb-D-rk2T1q_-iw@mail.gmail.com","subject":"Re: [PATCH] commit: configure submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-24T19:06:23Z","receivedAt":"2012-09-24T19:06:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Orgad Shaneh <orgads@gmail.com> writes:\n\n> That is not correct. git-config is ignored as well for commit.\n\nWhat do you mean?  As far as I can tell, if you have\n\n    [submodule \"var\"]\n        path = var\n\tignore = dirty\n\nin $GIT_DIR/config, a work-tree-dirty submodule \"var\" is not\nreported by \"git status\" and \"git commit\" without your patch, and\nyour patch does not seem to break that.  The only difference your\npatch makes is that if you had the above three-line block in\nthe .gitmodules file and not in $GIT_DIR/config, \"git status\"\nignored the dirtyness in the working tree, but \"git commit\" did\nnotice and report it.\n\nWhat am I missing?\n"},{"id":"199846","messageId":"CAGHpTB+0GLJJ-e1JFTXQ0Qot9An90MXxDFbP+63+pG2uA3UhmA@mail.gmail.com","threadId":"31630","inReplyTo":"7vy5jzxmts.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] commit: configure submodules","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2012-09-24T19:16:45Z","receivedAt":"2012-09-24T19:16:45Z","isPatch":true,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"On Mon, Sep 24, 2012 at 9:06 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Orgad Shaneh <orgads@gmail.com> writes:\n>\n>> That is not correct. git-config is ignored as well for commit.\n>\n> What do you mean?  As far as I can tell, if you have\n>\n>     [submodule \"var\"]\n>         path = var\n>         ignore = dirty\n>\n> in $GIT_DIR/config, a work-tree-dirty submodule \"var\" is not\n> reported by \"git status\" and \"git commit\" without your patch, and\n> your patch does not seem to break that.  The only difference your\n> patch makes is that if you had the above three-line block in\n> the .gitmodules file and not in $GIT_DIR/config, \"git status\"\n> ignored the dirtyness in the working tree, but \"git commit\" did\n> notice and report it.\n>\n> What am I missing?\n>\n>\n\nI have:\n[submodule \"mod\"]\n        url = [...]\n        ignore = dirty\n\nin .git/config, and I removed the ignore part from .gitmodules to be even.\n\nI made a change inside mod, git status doesn't report its dirtiness,\nwhile git commit does.\n\ngit status:\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       modified:   foo\n#\n# Changes not staged for commit:\n#   (use \"git add <file>...\" to update what will be committed)\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n#\n#       modified:   .gitmodules\n#\n\ngit commit:\n# Please enter the commit message for your changes. Lines starting\n# with '#' will be ignored, and an empty message aborts the commit.\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       modified:   foo\n#\n# Changes not staged for commit:\n#   (use \"git add <file>...\" to update what will be committed)\n#   (use \"git checkout -- <file>...\" to discard changes in working directory)\n#   (commit or discard the untracked or modified content in submodules)\n#\n#       modified:   .gitmodules\n#       modified:   mod (modified content)\n#\n\nNow I get it! That's because I don't have submodule.mod.path!\nconfig_name_for_path only gets initialized if path exists. Apparently\ngit submodule init doesn't configure 'path', so it stays\nuninitialized.\n\n- Orgad\n"},{"id":"199853","messageId":"5060BADB.2000505@web.de","threadId":"31630","inReplyTo":"CAGHpTB+0GLJJ-e1JFTXQ0Qot9An90MXxDFbP+63+pG2uA3UhmA@mail.gmail.com","subject":"Re: [PATCH] commit: configure submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-09-24T19:56:11Z","receivedAt":"2012-09-24T19:56:11Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 24.09.2012 21:16, schrieb Orgad Shaneh:\n> On Mon, Sep 24, 2012 at 9:06 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Orgad Shaneh <orgads@gmail.com> writes:\n>>\n>>> That is not correct. git-config is ignored as well for commit.\n>>\n>> What do you mean?  As far as I can tell, if you have\n>>\n>>     [submodule \"var\"]\n>>         path = var\n>>         ignore = dirty\n>>\n>> in $GIT_DIR/config, a work-tree-dirty submodule \"var\" is not\n>> reported by \"git status\" and \"git commit\" without your patch, and\n>> your patch does not seem to break that.  The only difference your\n>> patch makes is that if you had the above three-line block in\n>> the .gitmodules file and not in $GIT_DIR/config, \"git status\"\n>> ignored the dirtyness in the working tree, but \"git commit\" did\n>> notice and report it.\n>>\n>> What am I missing?\n>>\n>>\n> \n> I have:\n> [submodule \"mod\"]\n>         url = [...]\n>         ignore = dirty\n> \n> in .git/config, and I removed the ignore part from .gitmodules to be even.\n> \n> I made a change inside mod, git status doesn't report its dirtiness,\n> while git commit does.\n> \n> git status:\n> # On branch master\n> # Changes to be committed:\n> #   (use \"git reset HEAD <file>...\" to unstage)\n> #\n> #       modified:   foo\n> #\n> # Changes not staged for commit:\n> #   (use \"git add <file>...\" to update what will be committed)\n> #   (use \"git checkout -- <file>...\" to discard changes in working directory)\n> #\n> #       modified:   .gitmodules\n> #\n> \n> git commit:\n> # Please enter the commit message for your changes. Lines starting\n> # with '#' will be ignored, and an empty message aborts the commit.\n> # On branch master\n> # Changes to be committed:\n> #   (use \"git reset HEAD <file>...\" to unstage)\n> #\n> #       modified:   foo\n> #\n> # Changes not staged for commit:\n> #   (use \"git add <file>...\" to update what will be committed)\n> #   (use \"git checkout -- <file>...\" to discard changes in working directory)\n> #   (commit or discard the untracked or modified content in submodules)\n> #\n> #       modified:   .gitmodules\n> #       modified:   mod (modified content)\n> #\n> \n> Now I get it! That's because I don't have submodule.mod.path!\n> config_name_for_path only gets initialized if path exists. Apparently\n> git submodule init doesn't configure 'path', so it stays\n> uninitialized.\n\nBut submodule.mod.path should only be set in .gitmodules, not in\n$GIT_DIR/config. Did you just remove the ignore setting from\n.gitmodules or the path too?\n"},{"id":"199855","messageId":"CAGHpTBLs2tgUunDtFMhw7QMiuB2oXBtQJLKpLckhEyDp7Zr+Qg@mail.gmail.com","threadId":"31630","inReplyTo":"5060BADB.2000505@web.de","subject":"Re: [PATCH] commit: configure submodules","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2012-09-24T19:59:42Z","receivedAt":"2012-09-24T19:59:42Z","isPatch":true,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"On Mon, Sep 24, 2012 at 9:56 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n> Am 24.09.2012 21:16, schrieb Orgad Shaneh:\n>> On Mon, Sep 24, 2012 at 9:06 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Orgad Shaneh <orgads@gmail.com> writes:\n>>>\n>>>> That is not correct. git-config is ignored as well for commit.\n>>>\n>>> What do you mean?  As far as I can tell, if you have\n>>>\n>>>     [submodule \"var\"]\n>>>         path = var\n>>>         ignore = dirty\n>>>\n>>> in $GIT_DIR/config, a work-tree-dirty submodule \"var\" is not\n>>> reported by \"git status\" and \"git commit\" without your patch, and\n>>> your patch does not seem to break that.  The only difference your\n>>> patch makes is that if you had the above three-line block in\n>>> the .gitmodules file and not in $GIT_DIR/config, \"git status\"\n>>> ignored the dirtyness in the working tree, but \"git commit\" did\n>>> notice and report it.\n>>>\n>>> What am I missing?\n>>>\n>>>\n>>\n>> I have:\n>> [submodule \"mod\"]\n>>         url = [...]\n>>         ignore = dirty\n>>\n>> in .git/config, and I removed the ignore part from .gitmodules to be even.\n>>\n>> I made a change inside mod, git status doesn't report its dirtiness,\n>> while git commit does.\n>>\n>> git status:\n>> # On branch master\n>> # Changes to be committed:\n>> #   (use \"git reset HEAD <file>...\" to unstage)\n>> #\n>> #       modified:   foo\n>> #\n>> # Changes not staged for commit:\n>> #   (use \"git add <file>...\" to update what will be committed)\n>> #   (use \"git checkout -- <file>...\" to discard changes in working directory)\n>> #\n>> #       modified:   .gitmodules\n>> #\n>>\n>> git commit:\n>> # Please enter the commit message for your changes. Lines starting\n>> # with '#' will be ignored, and an empty message aborts the commit.\n>> # On branch master\n>> # Changes to be committed:\n>> #   (use \"git reset HEAD <file>...\" to unstage)\n>> #\n>> #       modified:   foo\n>> #\n>> # Changes not staged for commit:\n>> #   (use \"git add <file>...\" to update what will be committed)\n>> #   (use \"git checkout -- <file>...\" to discard changes in working directory)\n>> #   (commit or discard the untracked or modified content in submodules)\n>> #\n>> #       modified:   .gitmodules\n>> #       modified:   mod (modified content)\n>> #\n>>\n>> Now I get it! That's because I don't have submodule.mod.path!\n>> config_name_for_path only gets initialized if path exists. Apparently\n>> git submodule init doesn't configure 'path', so it stays\n>> uninitialized.\n>\n> But submodule.mod.path should only be set in .gitmodules, not in\n> $GIT_DIR/config. Did you just remove the ignore setting from\n> .gitmodules or the path too?\n\nJust the ignore, and my patch of course.\n\nIf it is not set in $GIT_DIR/config, then config_name_for_path is not\ninitialized, and if it is not initialized, then\nset_diffopt_flags_from_submodule_config does nothing\n(handle_ignore_submodules_arg is not called). That is the main\nproblem.\n\n- Orgad\n"},{"id":"199857","messageId":"5060BE4F.2040506@web.de","threadId":"31630","inReplyTo":"CAGHpTBLs2tgUunDtFMhw7QMiuB2oXBtQJLKpLckhEyDp7Zr+Qg@mail.gmail.com","subject":"Re: [PATCH] commit: configure submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2012-09-24T20:10:55Z","receivedAt":"2012-09-24T20:10:55Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 24.09.2012 21:59, schrieb Orgad Shaneh:\n> On Mon, Sep 24, 2012 at 9:56 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>> Am 24.09.2012 21:16, schrieb Orgad Shaneh:\n>>> On Mon, Sep 24, 2012 at 9:06 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>>> Orgad Shaneh <orgads@gmail.com> writes:\n>>>>\n>>>>> That is not correct. git-config is ignored as well for commit.\n>>>>\n>>>> What do you mean?  As far as I can tell, if you have\n>>>>\n>>>>     [submodule \"var\"]\n>>>>         path = var\n>>>>         ignore = dirty\n>>>>\n>>>> in $GIT_DIR/config, a work-tree-dirty submodule \"var\" is not\n>>>> reported by \"git status\" and \"git commit\" without your patch, and\n>>>> your patch does not seem to break that.  The only difference your\n>>>> patch makes is that if you had the above three-line block in\n>>>> the .gitmodules file and not in $GIT_DIR/config, \"git status\"\n>>>> ignored the dirtyness in the working tree, but \"git commit\" did\n>>>> notice and report it.\n>>>>\n>>>> What am I missing?\n>>>>\n>>>>\n>>>\n>>> I have:\n>>> [submodule \"mod\"]\n>>>         url = [...]\n>>>         ignore = dirty\n>>>\n>>> in .git/config, and I removed the ignore part from .gitmodules to be even.\n>>>\n>>> I made a change inside mod, git status doesn't report its dirtiness,\n>>> while git commit does.\n>>>\n>>> git status:\n>>> # On branch master\n>>> # Changes to be committed:\n>>> #   (use \"git reset HEAD <file>...\" to unstage)\n>>> #\n>>> #       modified:   foo\n>>> #\n>>> # Changes not staged for commit:\n>>> #   (use \"git add <file>...\" to update what will be committed)\n>>> #   (use \"git checkout -- <file>...\" to discard changes in working directory)\n>>> #\n>>> #       modified:   .gitmodules\n>>> #\n>>>\n>>> git commit:\n>>> # Please enter the commit message for your changes. Lines starting\n>>> # with '#' will be ignored, and an empty message aborts the commit.\n>>> # On branch master\n>>> # Changes to be committed:\n>>> #   (use \"git reset HEAD <file>...\" to unstage)\n>>> #\n>>> #       modified:   foo\n>>> #\n>>> # Changes not staged for commit:\n>>> #   (use \"git add <file>...\" to update what will be committed)\n>>> #   (use \"git checkout -- <file>...\" to discard changes in working directory)\n>>> #   (commit or discard the untracked or modified content in submodules)\n>>> #\n>>> #       modified:   .gitmodules\n>>> #       modified:   mod (modified content)\n>>> #\n>>>\n>>> Now I get it! That's because I don't have submodule.mod.path!\n>>> config_name_for_path only gets initialized if path exists. Apparently\n>>> git submodule init doesn't configure 'path', so it stays\n>>> uninitialized.\n>>\n>> But submodule.mod.path should only be set in .gitmodules, not in\n>> $GIT_DIR/config. Did you just remove the ignore setting from\n>> .gitmodules or the path too?\n> \n> Just the ignore, and my patch of course.\n> \n> If it is not set in $GIT_DIR/config, then config_name_for_path is not\n> initialized, and if it is not initialized, then\n> set_diffopt_flags_from_submodule_config does nothing\n> (handle_ignore_submodules_arg is not called). That is the main\n> problem.\n\nBut config_name_for_path can only be set via .gitmodules. It is set in\nparse_submodule_config_option() called by submodule_config() which is\ncalled from gitmodules_config() ... but only if .gitmodules doesn't\nhave a merge conflict.\n\nSo either your .gitmodules has a merge conflict or the logic setting\ngitmodules_is_unmerged in gitmodules_config() is buggy.\n"},{"id":"199859","messageId":"7vr4prxinb.fsf@alter.siamese.dyndns.org","threadId":"31630","inReplyTo":"5060BADB.2000505@web.de","subject":"Re: [PATCH] commit: configure submodules","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-24T20:36:40Z","receivedAt":"2012-09-24T20:36:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jens Lehmann <Jens.Lehmann@web.de> writes:\n\n> But submodule.mod.path should only be set in .gitmodules, not in\n> $GIT_DIR/config. Did you just remove the ignore setting from\n> .gitmodules or the path too?\n\nWithout that in $GIT_DIR/config, how would path<->name mapping\ncorrectly work???\n\nConfused...\n"}]}