{"thread":{"id":"49124","subject":"Bug with Git submodules and submodule.recurse setting","startedAt":"2018-08-14T17:54:04Z","lastAt":"2018-08-15T22:52:55Z","messageCount":5,"participants":["Jochen Kühner","Stefan Beller","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"355569","messageId":"929572FA-6B1D-4EC7-825B-93B96053A82C@gmx.de","threadId":"49124","inReplyTo":null,"subject":"Bug with Git submodules and submodule.recurse setting","fromName":"Jochen Kühner","fromEmail":"jochen.kuehner@gmx.de","sentAt":"2018-08-14T17:54:01Z","receivedAt":"2018-08-14T17:54:04Z","isPatch":false,"sender":{"key":"jochen.kuehner@gmx.de","avatar":null},"body":"If I set \n\n\n\n \n\ngit config --global submodule.recurse true\n\n\n\n\n\nand run git via:\n\n\n\n \n\ngit pull --progress -v --no-rebase \"origin\"\n\n\n\n\n\nThe command will fail with following output (Errorlevel is 1)\n\n \n\n\n\nFetching submodule submodules/tstemplates\n\n\n\nFrom http://10.0.102.194:7990/scm/mcc/tstemplates\n\n\n\n= [up to date]      feature/robin -> origin/feature/robin\n\n\n\n= [up to date]      master        -> origin/master\n\n\n\nAlready up to date.\n\n\n\nusage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]\n\n\n\n   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]\n\n\n\n   or: git submodule [--quiet] init [--] [<path>...]\n\n\n\n   or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)\n\n\n\n   or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]\n\n\n\n   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]\n\n\n\n   or: git submodule [--quiet] foreach [--recursive] <command>\n\n\n\n   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]\n\n\n\n   or: git submodule [--quiet] absorbgitdirs [--] [<path>...]\n\n\n\n \n\n\n\nseams that the “verbose” parameter “-v” is also sent to “git submodules” wich does not support it.\n\n\n\n \n\n\n\nIf I remove “-v” it will work.\n\n\n\n \n\n\n\nProblem is, I use TortoiseGit, wich will automatically create this command!\n\n\n\n \n\n\n\n\n\n\n\n\n\n"},{"id":"355583","messageId":"20180814182202.59442-1-sbeller@google.com","threadId":"49124","inReplyTo":"929572FA-6B1D-4EC7-825B-93B96053A82C@gmx.de","subject":"[PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-08-14T18:22:02Z","receivedAt":"2018-08-14T18:22:11Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"In a56771a668d (builtin/pull: respect verbosity settings in submodules,\n2018-01-25), we made sure to pass on both quiet and verbose flag from\nbuiltin/pull.c to the submodule shell script. However git-submodule doesn't\nunderstand a verbose flag, which results in a bug when invoking\n\n  git pull --recurse-submodules -v [...]\n\nThere are a few different approaches to fix this bug:\n\n1) rewrite 'argv_push_verbosity' or its caller in builtin/pull.c to\n   cap opt_verbosity at 0. Then 'argv_push_verbosity' would only add\n   '-q' if any.\n\n2) Have a flag in 'argv_push_verbosity' that specifies if we allow adding\n  -q or -v (or both).\n\n3) Add -v to git-submodule.sh and make it a no-op\n\n(1) seems like a maintenance burden: What if we add code after\nthe submodule operations or move submodule operations higher up,\nthen we have altered the opt_verbosity setting further down the line\nin builtin/pull.c.\n\n(2) seems like it could work reasonably well without more regressions\n\n(3) seems easiest to implement as well as actually is a feature with the\n    last-one-wins rule of passing flags to Git commands.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n\nOn Tue, Aug 14, 2018 at 10:54 AM Jochen Kühner <jochen.kuehner@gmx.de> wrote:\n>\n> If I set \n> git config --global submodule.recurse true\n> and run git via:\n> git pull --progress -v --no-rebase \"origin\"\n> The command will fail with following output (Errorlevel is 1)\n> Fetching submodule submodules/tstemplates\n> From http://10.0.102.194:7990/scm/mcc/tstemplates\n> = [up to date]      feature/robin -> origin/feature/robin\n> = [up to date]      master        -> origin/master\n> Already up to date.\n> usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]\n>    or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]\n>    or: git submodule [--quiet] init [--] [<path>...]\n>    or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)\n>    or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]\n>    or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]\n>    or: git submodule [--quiet] foreach [--recursive] <command>\n>    or: git submodule [--quiet] sync [--recursive] [--] [<path>...]\n>    or: git submodule [--quiet] absorbgitdirs [--] [<path>...]\n>\n> seams that the “verbose” parameter “-v” is also sent to “git submodules” wich does not support it.\n>\n> If I remove “-v” it will work.\n>\n> Problem is, I use TortoiseGit, wich will automatically create this command!\n\n git-submodule.sh | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 8b5ad59bdee..f7fd80345cd 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -438,6 +438,9 @@ cmd_update()\n \t\t-q|--quiet)\n \t\t\tGIT_QUIET=1\n \t\t\t;;\n+\t\t-v)\n+\t\t\tGIT_QUIET=0\n+\t\t\t;;\n \t\t--progress)\n \t\t\tprogress=1\n \t\t\t;;\n-- \n2.18.0.265.g16de1b435c9.dirty\n\n"},{"id":"355584","messageId":"20180814182807.GA142615@aiede.svl.corp.google.com","threadId":"49124","inReplyTo":"20180814182202.59442-1-sbeller@google.com","subject":"Re: [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2018-08-14T18:28:07Z","receivedAt":"2018-08-14T18:28:12Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Stefan Beller wrote:\n\n>  git-submodule.sh | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/git-submodule.sh b/git-submodule.sh\n> index 8b5ad59bdee..f7fd80345cd 100755\n> --- a/git-submodule.sh\n> +++ b/git-submodule.sh\n> @@ -438,6 +438,9 @@ cmd_update()\n>  \t\t-q|--quiet)\n>  \t\t\tGIT_QUIET=1\n>  \t\t\t;;\n> +\t\t-v)\n> +\t\t\tGIT_QUIET=0\n> +\t\t\t;;\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.\n"},{"id":"355675","messageId":"trinity-1b5bee3c-e801-483f-b555-7ad0b97f5239-1534314471150@3c-app-gmx-bs78","threadId":"49124","inReplyTo":"20180814182202.59442-1-sbeller@google.com","subject":"Aw: [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet","fromName":"Jochen Kühner","fromEmail":"jochen.kuehner@gmx.de","sentAt":"2018-08-15T06:27:51Z","receivedAt":"2018-08-15T06:27:54Z","isPatch":true,"sender":{"key":"jochen.kuehner@gmx.de","avatar":null},"body":"\n \n\nWe use git for windows, there I cannot fin the git-submodule.sh! How can I fix it there?\n \n\nGesendet: Dienstag, 14. August 2018 um 20:22 Uhr\nVon: \"Stefan Beller\" <sbeller@google.com>\nAn: jochen.kuehner@gmx.de\nCc: git@vger.kernel.org, \"Stefan Beller\" <sbeller@google.com>\nBetreff: [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet\nIn a56771a668d (builtin/pull: respect verbosity settings in submodules,\n2018-01-25), we made sure to pass on both quiet and verbose flag from\nbuiltin/pull.c to the submodule shell script. However git-submodule doesn't\nunderstand a verbose flag, which results in a bug when invoking\n\ngit pull --recurse-submodules -v [...]\n\nThere are a few different approaches to fix this bug:\n\n1) rewrite 'argv_push_verbosity' or its caller in builtin/pull.c to\ncap opt_verbosity at 0. Then 'argv_push_verbosity' would only add\n'-q' if any.\n\n2) Have a flag in 'argv_push_verbosity' that specifies if we allow adding\n-q or -v (or both).\n\n3) Add -v to git-submodule.sh and make it a no-op\n\n(1) seems like a maintenance burden: What if we add code after\nthe submodule operations or move submodule operations higher up,\nthen we have altered the opt_verbosity setting further down the line\nin builtin/pull.c.\n\n(2) seems like it could work reasonably well without more regressions\n\n(3) seems easiest to implement as well as actually is a feature with the\nlast-one-wins rule of passing flags to Git commands.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n\nOn Tue, Aug 14, 2018 at 10:54 AM Jochen Kühner <jochen.kuehner@gmx.de> wrote:\n>\n> If I set\n> git config --global submodule.recurse true\n> and run git via:\n> git pull --progress -v --no-rebase \"origin\"\n> The command will fail with following output (Errorlevel is 1)\n> Fetching submodule submodules/tstemplates\n> From http://10.0.102.194:7990/scm/mcc/tstemplates\n> = [up to date] feature/robin -> origin/feature/robin\n> = [up to date] master -> origin/master\n> Already up to date.\n> usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]\n> or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]\n> or: git submodule [--quiet] init [--] [<path>...]\n> or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)\n> or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]\n> or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]\n> or: git submodule [--quiet] foreach [--recursive] <command>\n> or: git submodule [--quiet] sync [--recursive] [--] [<path>...]\n> or: git submodule [--quiet] absorbgitdirs [--] [<path>...]\n>\n> seams that the “verbose” parameter “-v” is also sent to “git submodules” wich does not support it.\n>\n> If I remove “-v” it will work.\n>\n> Problem is, I use TortoiseGit, wich will automatically create this command!\n\ngit-submodule.sh | 3 +++\n1 file changed, 3 insertions(+)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 8b5ad59bdee..f7fd80345cd 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -438,6 +438,9 @@ cmd_update()\n-q|--quiet)\nGIT_QUIET=1\n;;\n+ -v)\n+ GIT_QUIET=0\n+ ;;\n--progress)\nprogress=1\n;;\n--\n2.18.0.265.g16de1b435c9.dirty\n \n"},{"id":"355777","messageId":"CAGZ79kZdeqHrc0aREuez9FQjEc=2-b2+t3FGCd01ob+1aAX65g@mail.gmail.com","threadId":"49124","inReplyTo":"trinity-1b5bee3c-e801-483f-b555-7ad0b97f5239-1534314471150@3c-app-gmx-bs78","subject":"Re: [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-08-15T22:52:40Z","receivedAt":"2018-08-15T22:52:55Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, Aug 14, 2018 at 11:27 PM \"Jochen Kühner\" <jochen.kuehner@gmx.de> wrote:\n>\n>\n>\n>\n> We use git for windows, there I cannot fin the git-submodule.sh! How can I fix it there?\n>\n>\n\nIt probably doesn't have the .sh extension. I don't know where all git\nexecutables are located in GfW.\n\nMaybe \"dir /s git.exe\" can give you a starting point to look for the\nexecutables of Git.\n(courtesy stackoverflow, I am no expert on Windows)\n\nAs git-submodule is a shell script and doesn't need compilation, you\ncan just edit\nthis in to see if it fixes the problem; mind to use a text editor that\ndoesn't put CRLF,\nbut LF line endings only in that file ... shell script is not the most portable.\n"}]}