{"thread":{"id":"34719","subject":"[PATCH v2 0/2] Don't print status output with submodule.<name>.ignore=all","startedAt":"2013-08-17T17:25:41Z","lastAt":"2013-08-19T21:14:19Z","messageCount":5,"participants":["brian m. carlson","Jens Lehmann"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"225378","messageId":"1376760343-741047-1-git-send-email-sandals@crustytoothpaste.net","threadId":"34719","inReplyTo":null,"subject":"[PATCH v2 0/2] Don't print status output with submodule.<name>.ignore=all","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2013-08-17T17:25:41Z","receivedAt":"2013-08-17T17:25:41Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"There are configuration options for each submodule that specify under what\ncircumstances git status should display output for that submodule.\nUnfortunately, these settings were not being respected, and as such the tests\nwere marked TODO.\n\nThis patch series consists of two patches: the first is a fix for a confusing\nvariable name, and the latter actually makes git status not output the submodule\ninformation.  The tests have been updated accordingly.\n\nChanges from v1:\n\n* Handle moved submodules by not ignoring them.\n* Use sm_path instead of path.\n* Only ignore when --for-status is given.\n\nbrian m. carlson (2):\n  submodule: fix confusing variable name\n  submodule: don't print status output with ignore=all\n\n git-submodule.sh  | 15 +++++++++++----\n t/t7508-status.sh |  4 ++--\n 2 files changed, 13 insertions(+), 6 deletions(-)\n\n-- \n1.8.4.rc2.564.g10ce5ae\n"},{"id":"225380","messageId":"1376760343-741047-2-git-send-email-sandals@crustytoothpaste.net","threadId":"34719","inReplyTo":"1376760343-741047-1-git-send-email-sandals@crustytoothpaste.net","subject":"[PATCH v2 1/2] submodule: fix confusing variable name","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2013-08-17T17:25:42Z","receivedAt":"2013-08-17T17:25:42Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"cmd_summary reads the output of git diff, but reads in the submodule path into a\nvariable called name.  Since this variable does not contain the name of the\nsubmodule, but the path, rename it to be clearer what data it actually holds.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n git-submodule.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 2979197..38520db 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -1032,13 +1032,13 @@ cmd_summary() {\n \t# Get modified modules cared by user\n \tmodules=$(git $diff_cmd $cached --ignore-submodules=dirty --raw $head -- \"$@\" |\n \t\tsane_egrep '^:([0-7]* )?160000' |\n-\t\twhile read mod_src mod_dst sha1_src sha1_dst status name\n+\t\twhile read mod_src mod_dst sha1_src sha1_dst status sm_path\n \t\tdo\n \t\t\t# Always show modules deleted or type-changed (blob<->module)\n-\t\t\ttest $status = D -o $status = T && echo \"$name\" && continue\n+\t\t\ttest $status = D -o $status = T && echo \"$sm_path\" && continue\n \t\t\t# Also show added or modified modules which are checked out\n-\t\t\tGIT_DIR=\"$name/.git\" git-rev-parse --git-dir >/dev/null 2>&1 &&\n-\t\t\techo \"$name\"\n+\t\t\tGIT_DIR=\"$sm_path/.git\" git-rev-parse --git-dir >/dev/null 2>&1 &&\n+\t\t\techo \"$sm_path\"\n \t\tdone\n \t)\n \n-- \n1.8.4.rc2.564.g10ce5ae\n"},{"id":"225379","messageId":"1376760343-741047-3-git-send-email-sandals@crustytoothpaste.net","threadId":"34719","inReplyTo":"1376760343-741047-1-git-send-email-sandals@crustytoothpaste.net","subject":"[PATCH v2 2/2] submodule: don't print status output with ignore=all","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2013-08-17T17:25:43Z","receivedAt":"2013-08-17T17:25:43Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"git status prints information for submodules, but it should ignore the status of\nthose which have submodule.<name>.ignore set to all.  Fix it so that it does\nproperly ignore those which have that setting either in .git/config or in\n.gitmodules.\n\nNot ignored are submodules that are added, deleted, or moved (which is\nessentially a combination of the first two) because it is not easily possible to\ndetermine the old path once a move has occurred, nor is it easily possible to\ndetect which adds and deletions are moves and which are not.  This also\npreserves the previous behavior of always listing modules which are to be\ndeleted.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n git-submodule.sh  | 7 +++++++\n t/t7508-status.sh | 4 ++--\n 2 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 38520db..c1ba0f8 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -1036,6 +1036,13 @@ cmd_summary() {\n \t\tdo\n \t\t\t# Always show modules deleted or type-changed (blob<->module)\n \t\t\ttest $status = D -o $status = T && echo \"$sm_path\" && continue\n+\t\t\t# Respect the ignore setting for --for-status.\n+\t\t\tif test -n $for_status\n+\t\t\tthen\n+\t\t\t\tname=$(module_name \"$sm_path\")\n+\t\t\t\tignore_config=$(get_submodule_config \"$name\" ignore none)\n+\t\t\t\ttest $status != A -a $ignore_config = all && continue\n+\t\t\tfi\n \t\t\t# Also show added or modified modules which are checked out\n \t\t\tGIT_DIR=\"$sm_path/.git\" git-rev-parse --git-dir >/dev/null 2>&1 &&\n \t\t\techo \"$sm_path\"\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex ac3d0fe..fb89fb9 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -1316,7 +1316,7 @@ test_expect_success \"--ignore-submodules=all suppresses submodule summary\" '\n \ttest_i18ncmp expect output\n '\n \n-test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '\n+test_expect_success '.gitmodules ignore=all suppresses submodule summary' '\n \tgit config --add -f .gitmodules submodule.subname.ignore all &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status > output &&\n@@ -1324,7 +1324,7 @@ test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '\n \tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n-test_expect_failure '.git/config ignore=all suppresses submodule summary' '\n+test_expect_success '.git/config ignore=all suppresses submodule summary' '\n \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit config --add submodule.subname.ignore all &&\n-- \n1.8.4.rc2.564.g10ce5ae\n"},{"id":"225479","messageId":"52128991.8080603@web.de","threadId":"34719","inReplyTo":"1376760343-741047-2-git-send-email-sandals@crustytoothpaste.net","subject":"Re: [PATCH v2 1/2] submodule: fix confusing variable name","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2013-08-19T21:09:37Z","receivedAt":"2013-08-19T21:09:37Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 17.08.2013 19:25, schrieb brian m. carlson:\n> cmd_summary reads the output of git diff, but reads in the submodule path into a\n> variable called name.  Since this variable does not contain the name of the\n> submodule, but the path, rename it to be clearer what data it actually holds.\n> \n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n\nThanks, this one is looking good to me.\n\nAcked-by: Jens Lehmann <Jens.Lehmann@web.de>\n\n> ---\n>  git-submodule.sh | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/git-submodule.sh b/git-submodule.sh\n> index 2979197..38520db 100755\n> --- a/git-submodule.sh\n> +++ b/git-submodule.sh\n> @@ -1032,13 +1032,13 @@ cmd_summary() {\n>  \t# Get modified modules cared by user\n>  \tmodules=$(git $diff_cmd $cached --ignore-submodules=dirty --raw $head -- \"$@\" |\n>  \t\tsane_egrep '^:([0-7]* )?160000' |\n> -\t\twhile read mod_src mod_dst sha1_src sha1_dst status name\n> +\t\twhile read mod_src mod_dst sha1_src sha1_dst status sm_path\n>  \t\tdo\n>  \t\t\t# Always show modules deleted or type-changed (blob<->module)\n> -\t\t\ttest $status = D -o $status = T && echo \"$name\" && continue\n> +\t\t\ttest $status = D -o $status = T && echo \"$sm_path\" && continue\n>  \t\t\t# Also show added or modified modules which are checked out\n> -\t\t\tGIT_DIR=\"$name/.git\" git-rev-parse --git-dir >/dev/null 2>&1 &&\n> -\t\t\techo \"$name\"\n> +\t\t\tGIT_DIR=\"$sm_path/.git\" git-rev-parse --git-dir >/dev/null 2>&1 &&\n> +\t\t\techo \"$sm_path\"\n>  \t\tdone\n>  \t)\n>  \n> \n"},{"id":"225480","messageId":"52128AAB.1010401@web.de","threadId":"34719","inReplyTo":"1376760343-741047-3-git-send-email-sandals@crustytoothpaste.net","subject":"Re: [PATCH v2 2/2] submodule: don't print status output with ignore=all","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2013-08-19T21:14:19Z","receivedAt":"2013-08-19T21:14:19Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 17.08.2013 19:25, schrieb brian m. carlson:\n> git status prints information for submodules, but it should ignore the status of\n> those which have submodule.<name>.ignore set to all.  Fix it so that it does\n> properly ignore those which have that setting either in .git/config or in\n> .gitmodules.\n> \n> Not ignored are submodules that are added, deleted, or moved (which is\n> essentially a combination of the first two) because it is not easily possible to\n> determine the old path once a move has occurred, nor is it easily possible to\n> detect which adds and deletions are moves and which are not.  This also\n> preserves the previous behavior of always listing modules which are to be\n> deleted.\n\nSounds sane. Even though we should be able to follow renames by inspecting\nthe old .gitmodules content with the new --blob option of git config, I doubt\nit'll be worth the hassle. Thanks for fixing two known test breakages.\n\nAcked-by: Jens Lehmann <Jens.Lehmann@web.de>\n\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>  git-submodule.sh  | 7 +++++++\n>  t/t7508-status.sh | 4 ++--\n>  2 files changed, 9 insertions(+), 2 deletions(-)\n> \n> diff --git a/git-submodule.sh b/git-submodule.sh\n> index 38520db..c1ba0f8 100755\n> --- a/git-submodule.sh\n> +++ b/git-submodule.sh\n> @@ -1036,6 +1036,13 @@ cmd_summary() {\n>  \t\tdo\n>  \t\t\t# Always show modules deleted or type-changed (blob<->module)\n>  \t\t\ttest $status = D -o $status = T && echo \"$sm_path\" && continue\n> +\t\t\t# Respect the ignore setting for --for-status.\n> +\t\t\tif test -n $for_status\n> +\t\t\tthen\n> +\t\t\t\tname=$(module_name \"$sm_path\")\n> +\t\t\t\tignore_config=$(get_submodule_config \"$name\" ignore none)\n> +\t\t\t\ttest $status != A -a $ignore_config = all && continue\n> +\t\t\tfi\n>  \t\t\t# Also show added or modified modules which are checked out\n>  \t\t\tGIT_DIR=\"$sm_path/.git\" git-rev-parse --git-dir >/dev/null 2>&1 &&\n>  \t\t\techo \"$sm_path\"\n> diff --git a/t/t7508-status.sh b/t/t7508-status.sh\n> index ac3d0fe..fb89fb9 100755\n> --- a/t/t7508-status.sh\n> +++ b/t/t7508-status.sh\n> @@ -1316,7 +1316,7 @@ test_expect_success \"--ignore-submodules=all suppresses submodule summary\" '\n>  \ttest_i18ncmp expect output\n>  '\n>  \n> -test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '\n> +test_expect_success '.gitmodules ignore=all suppresses submodule summary' '\n>  \tgit config --add -f .gitmodules submodule.subname.ignore all &&\n>  \tgit config --add -f .gitmodules submodule.subname.path sm &&\n>  \tgit status > output &&\n> @@ -1324,7 +1324,7 @@ test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '\n>  \tgit config -f .gitmodules  --remove-section submodule.subname\n>  '\n>  \n> -test_expect_failure '.git/config ignore=all suppresses submodule summary' '\n> +test_expect_success '.git/config ignore=all suppresses submodule summary' '\n>  \tgit config --add -f .gitmodules submodule.subname.ignore none &&\n>  \tgit config --add -f .gitmodules submodule.subname.path sm &&\n>  \tgit config --add submodule.subname.ignore all &&\n> \n"}]}