{"thread":{"id":"34723","subject":"[PATCH] submodule: prevent warning in summary output","startedAt":"2013-08-18T17:31:35Z","lastAt":"2013-08-19T21:17:31Z","messageCount":3,"participants":["brian m. carlson","Chris Packham","Jens Lehmann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"225399","messageId":"1376847095-767956-1-git-send-email-sandals@crustytoothpaste.net","threadId":"34723","inReplyTo":null,"subject":"[PATCH] submodule: prevent warning in summary output","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2013-08-18T17:31:35Z","receivedAt":"2013-08-18T17:31:35Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"When git submodule summary is run and there is a deleted submodule, there is an\nwarning from git rev-parse:\n\n  fatal: Not a git repository: '.vim/pathogen/.git'\n\nSilence this warning, since it is fully expected that a deleted submodule will\nnot be a git repository.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n git-submodule.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 2979197..66ee621 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -1071,7 +1071,7 @@ cmd_summary() {\n \t\tmissing_dst=\n \n \t\ttest $mod_src = 160000 &&\n-\t\t! GIT_DIR=\"$name/.git\" git-rev-parse -q --verify $sha1_src^0 >/dev/null &&\n+\t\t! GIT_DIR=\"$name/.git\" git-rev-parse -q --verify $sha1_src^0 >/dev/null 2>&1 &&\n \t\tmissing_src=t\n \n \t\ttest $mod_dst = 160000 &&\n-- \n1.8.4.rc2.564.g10ce5ae\n"},{"id":"225445","messageId":"5211D3AA.6060403@gmail.com","threadId":"34723","inReplyTo":"1376847095-767956-1-git-send-email-sandals@crustytoothpaste.net","subject":"Re: [PATCH] submodule: prevent warning in summary output","fromName":"Chris Packham","fromEmail":"judge.packham@gmail.com","sentAt":"2013-08-19T08:13:30Z","receivedAt":"2013-08-19T08:13:30Z","isPatch":true,"sender":{"key":"judge.packham@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155667?v=4"},"body":"Hi Brian,\nOn 19/08/13 05:31, brian m. carlson wrote:\n> When git submodule summary is run and there is a deleted submodule, there is an\n> warning from git rev-parse:\n> \n>   fatal: Not a git repository: '.vim/pathogen/.git'\n> \n> Silence this warning, since it is fully expected that a deleted submodule will\n> not be a git repository.\n> \n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>  git-submodule.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/git-submodule.sh b/git-submodule.sh\n> index 2979197..66ee621 100755\n> --- a/git-submodule.sh\n> +++ b/git-submodule.sh\n> @@ -1071,7 +1071,7 @@ cmd_summary() {\n>  \t\tmissing_dst=\n>  \n>  \t\ttest $mod_src = 160000 &&\n> -\t\t! GIT_DIR=\"$name/.git\" git-rev-parse -q --verify $sha1_src^0 >/dev/null &&\n> +\t\t! GIT_DIR=\"$name/.git\" git-rev-parse -q --verify $sha1_src^0 >/dev/null 2>&1 &&\n>  \t\tmissing_src=t\n>  \n>  \t\ttest $mod_dst = 160000 &&\n> \n\nI wonder if there are other useful errors this will silence\nunintentionally. Perhaps this would be better (untested)\n\n test $mod_src = 160000 &&\n test -e \"$name/.git\" &&\n ! GIT_DIR=\"$name/.git\" git-rev-parse -q --verify $sha1_src^0 /dev/null &&\n  missing_src=t\n\nHaving said that there are precedents for both in git-submodule.sh. If\nthere aren't any errors worth catching here then your way is probably\ncleaner than mine.\n\n- C\n"},{"id":"225481","messageId":"52128B6B.6090604@web.de","threadId":"34723","inReplyTo":"5211D3AA.6060403@gmail.com","subject":"Re: [PATCH] submodule: prevent warning in summary output","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2013-08-19T21:17:31Z","receivedAt":"2013-08-19T21:17:31Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 19.08.2013 10:13, schrieb Chris Packham:\n> Hi Brian,\n> On 19/08/13 05:31, brian m. carlson wrote:\n>> When git submodule summary is run and there is a deleted submodule, there is an\n>> warning from git rev-parse:\n>>\n>>   fatal: Not a git repository: '.vim/pathogen/.git'\n>>\n>> Silence this warning, since it is fully expected that a deleted submodule will\n>> not be a git repository.\n>>\n>> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n>> ---\n>>  git-submodule.sh | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/git-submodule.sh b/git-submodule.sh\n>> index 2979197..66ee621 100755\n>> --- a/git-submodule.sh\n>> +++ b/git-submodule.sh\n>> @@ -1071,7 +1071,7 @@ cmd_summary() {\n>>  \t\tmissing_dst=\n>>  \n>>  \t\ttest $mod_src = 160000 &&\n>> -\t\t! GIT_DIR=\"$name/.git\" git-rev-parse -q --verify $sha1_src^0 >/dev/null &&\n>> +\t\t! GIT_DIR=\"$name/.git\" git-rev-parse -q --verify $sha1_src^0 >/dev/null 2>&1 &&\n>>  \t\tmissing_src=t\n>>  \n>>  \t\ttest $mod_dst = 160000 &&\n>>\n> \n> I wonder if there are other useful errors this will silence\n> unintentionally. Perhaps this would be better (untested)\n> \n>  test $mod_src = 160000 &&\n>  test -e \"$name/.git\" &&\n>  ! GIT_DIR=\"$name/.git\" git-rev-parse -q --verify $sha1_src^0 /dev/null &&\n>   missing_src=t\n> \n> Having said that there are precedents for both in git-submodule.sh. If\n> there aren't any errors worth catching here then your way is probably\n> cleaner than mine.\n\nI'd prefer a way to not drop all errors too. We should be able to use\nthe status variable to see if the submodule is deleted and then skip\nthe rev-parse all together, or am I missing something here?\n"}]}