{"thread":{"id":"13528","subject":"[PATCH] Use '-f' option to point to the .gitmodules file","startedAt":"2008-05-15T07:42:58Z","lastAt":"2008-05-20T03:12:02Z","messageCount":3,"participants":["imyousuf@gmail.com","Johannes Schindelin","Imran M Yousuf"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"77028","messageId":"1210837378-25668-1-git-send-email-imyousuf@gmail.com","threadId":"13528","inReplyTo":null,"subject":"[PATCH] Use '-f' option to point to the .gitmodules file","fromName":"","fromEmail":"imyousuf@gmail.com","sentAt":"2008-05-15T07:42:58Z","receivedAt":"2008-05-15T07:42:58Z","isPatch":true,"sender":{"key":"imyousuf@gmail.com","avatar":"https://gravatar.com/avatar/fda3c870262849d03c7b9c4d288842e128d6d80769fa7bc2d22731b7597928be?d=mp&s=160"},"body":"From: Imran M Yousuf <imyousuf@smartitengineering.com>\n\n'git config' has a '-f' option that takes the file to parse.\nUsing it rather than the environment variable seems more logical\nand simplified.\n\nSigned-off-by: Imran M Yousuf <imyousuf@smartitengineering.com>\n---\n git-submodule.sh |    9 ++++-----\n 1 files changed, 4 insertions(+), 5 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 67f7a28..b4b7d28 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -74,8 +74,7 @@ module_name()\n {\n \t# Do we have \"submodule.<something>.path = $1\" defined in .gitmodules file?\n \tre=$(printf '%s' \"$1\" | sed -e 's/[].[^$\\\\*]/\\\\&/g')\n-\tname=$( GIT_CONFIG=.gitmodules \\\n-\t\tgit config --get-regexp '^submodule\\..*\\.path$' |\n+\tname=$( git config -f .gitmodules --get-regexp '^submodule\\..*\\.path$' |\n \t\tsed -n -e 's|^submodule\\.\\(.*\\)\\.path '\"$re\"'$|\\1|p' )\n        test -z \"$name\" &&\n        die \"No submodule mapping found in .gitmodules for path '$path'\"\n@@ -198,8 +197,8 @@ cmd_add()\n \tgit add \"$path\" ||\n \tdie \"Failed to add submodule '$path'\"\n \n-\tGIT_CONFIG=.gitmodules git config submodule.\"$path\".path \"$path\" &&\n-\tGIT_CONFIG=.gitmodules git config submodule.\"$path\".url \"$repo\" &&\n+\tgit config -f .gitmodules submodule.\"$path\".path \"$path\" &&\n+\tgit config -f .gitmodules submodule.\"$path\".url \"$repo\" &&\n \tgit add .gitmodules ||\n \tdie \"Failed to register submodule '$path'\"\n }\n@@ -240,7 +239,7 @@ cmd_init()\n \t\turl=$(git config submodule.\"$name\".url)\n \t\ttest -z \"$url\" || continue\n \n-\t\turl=$(GIT_CONFIG=.gitmodules git config submodule.\"$name\".url)\n+\t\turl=$(git config -f .gitmodules submodule.\"$name\".url)\n \t\ttest -z \"$url\" &&\n \t\tdie \"No url found for submodule path '$path' in .gitmodules\"\n \n-- \n1.5.4.2\n"},{"id":"77032","messageId":"alpine.DEB.1.00.0805150956050.30431@racer","threadId":"13528","inReplyTo":"1210837378-25668-1-git-send-email-imyousuf@gmail.com","subject":"Re: [PATCH] Use '-f' option to point to the .gitmodules file","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-15T08:56:18Z","receivedAt":"2008-05-15T08:56:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 15 May 2008, imyousuf@gmail.com wrote:\n\n> From: Imran M Yousuf <imyousuf@smartitengineering.com>\n> \n> 'git config' has a '-f' option that takes the file to parse.\n> Using it rather than the environment variable seems more logical\n> and simplified.\n\nDefinitely looks more readable.\n\nCiao,\nDscho\n"},{"id":"77303","messageId":"7bfdc29a0805192012w5bf3a158y81f9623d57b71b10@mail.gmail.com","threadId":"13528","inReplyTo":"alpine.DEB.1.00.0805150956050.30431@racer","subject":"Re: [PATCH] Use '-f' option to point to the .gitmodules file","fromName":"Imran M Yousuf","fromEmail":"imyousuf@gmail.com","sentAt":"2008-05-20T03:12:02Z","receivedAt":"2008-05-20T03:12:02Z","isPatch":true,"sender":{"key":"imyousuf@gmail.com","avatar":"https://gravatar.com/avatar/fda3c870262849d03c7b9c4d288842e128d6d80769fa7bc2d22731b7597928be?d=mp&s=160"},"body":"Thanks for accepting the patch :).\n\nBest regards,\n\nImran\nOn Thu, May 15, 2008 at 2:56 PM, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Thu, 15 May 2008, imyousuf@gmail.com wrote:\n>\n>> From: Imran M Yousuf <imyousuf@smartitengineering.com>\n>>\n>> 'git config' has a '-f' option that takes the file to parse.\n>> Using it rather than the environment variable seems more logical\n>> and simplified.\n>\n> Definitely looks more readable.\n>\n> Ciao,\n> Dscho\n>\n\n\n\n-- \nImran M Yousuf\n"}]}