* Bug with Git submodules and submodule.recurse setting
@ 2018-08-14 17:54 Jochen Kühner
2018-08-14 18:22 ` [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet Stefan Beller
0 siblings, 1 reply; 5+ messages in thread
From: Jochen Kühner @ 2018-08-14 17:54 UTC (permalink / raw)
To: git
If I set
git config --global submodule.recurse true
and run git via:
git pull --progress -v --no-rebase "origin"
The command will fail with following output (Errorlevel is 1)
Fetching submodule submodules/tstemplates
From http://10.0.102.194:7990/scm/mcc/tstemplates
= [up to date] feature/robin -> origin/feature/robin
= [up to date] master -> origin/master
Already up to date.
usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
or: git submodule [--quiet] init [--] [<path>...]
or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]
or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
or: git submodule [--quiet] foreach [--recursive] <command>
or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
or: git submodule [--quiet] absorbgitdirs [--] [<path>...]
seams that the “verbose” parameter “-v” is also sent to “git submodules” wich does not support it.
If I remove “-v” it will work.
Problem is, I use TortoiseGit, wich will automatically create this command!
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet
2018-08-14 17:54 Bug with Git submodules and submodule.recurse setting Jochen Kühner
@ 2018-08-14 18:22 ` Stefan Beller
2018-08-14 18:28 ` Jonathan Nieder
2018-08-15 6:27 ` Aw: " "Jochen Kühner"
0 siblings, 2 replies; 5+ messages in thread
From: Stefan Beller @ 2018-08-14 18:22 UTC (permalink / raw)
To: jochen.kuehner; +Cc: git, Stefan Beller
In a56771a668d (builtin/pull: respect verbosity settings in submodules,
2018-01-25), we made sure to pass on both quiet and verbose flag from
builtin/pull.c to the submodule shell script. However git-submodule doesn't
understand a verbose flag, which results in a bug when invoking
git pull --recurse-submodules -v [...]
There are a few different approaches to fix this bug:
1) rewrite 'argv_push_verbosity' or its caller in builtin/pull.c to
cap opt_verbosity at 0. Then 'argv_push_verbosity' would only add
'-q' if any.
2) Have a flag in 'argv_push_verbosity' that specifies if we allow adding
-q or -v (or both).
3) Add -v to git-submodule.sh and make it a no-op
(1) seems like a maintenance burden: What if we add code after
the submodule operations or move submodule operations higher up,
then we have altered the opt_verbosity setting further down the line
in builtin/pull.c.
(2) seems like it could work reasonably well without more regressions
(3) seems easiest to implement as well as actually is a feature with the
last-one-wins rule of passing flags to Git commands.
Signed-off-by: Stefan Beller <sbeller@google.com>
---
On Tue, Aug 14, 2018 at 10:54 AM Jochen Kühner <jochen.kuehner@gmx.de> wrote:
>
> If I set
> git config --global submodule.recurse true
> and run git via:
> git pull --progress -v --no-rebase "origin"
> The command will fail with following output (Errorlevel is 1)
> Fetching submodule submodules/tstemplates
> From http://10.0.102.194:7990/scm/mcc/tstemplates
> = [up to date] feature/robin -> origin/feature/robin
> = [up to date] master -> origin/master
> Already up to date.
> usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
> or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
> or: git submodule [--quiet] init [--] [<path>...]
> or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
> or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]
> or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
> or: git submodule [--quiet] foreach [--recursive] <command>
> or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
> or: git submodule [--quiet] absorbgitdirs [--] [<path>...]
>
> seams that the “verbose” parameter “-v” is also sent to “git submodules” wich does not support it.
>
> If I remove “-v” it will work.
>
> Problem is, I use TortoiseGit, wich will automatically create this command!
git-submodule.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/git-submodule.sh b/git-submodule.sh
index 8b5ad59bdee..f7fd80345cd 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -438,6 +438,9 @@ cmd_update()
-q|--quiet)
GIT_QUIET=1
;;
+ -v)
+ GIT_QUIET=0
+ ;;
--progress)
progress=1
;;
--
2.18.0.265.g16de1b435c9.dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet
2018-08-14 18:22 ` [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet Stefan Beller
@ 2018-08-14 18:28 ` Jonathan Nieder
2018-08-15 6:27 ` Aw: " "Jochen Kühner"
1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Nieder @ 2018-08-14 18:28 UTC (permalink / raw)
To: Stefan Beller; +Cc: jochen.kuehner, git
Stefan Beller wrote:
> git-submodule.sh | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 8b5ad59bdee..f7fd80345cd 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -438,6 +438,9 @@ cmd_update()
> -q|--quiet)
> GIT_QUIET=1
> ;;
> + -v)
> + GIT_QUIET=0
> + ;;
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Aw: [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet
2018-08-14 18:22 ` [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet Stefan Beller
2018-08-14 18:28 ` Jonathan Nieder
@ 2018-08-15 6:27 ` "Jochen Kühner"
2018-08-15 22:52 ` Stefan Beller
1 sibling, 1 reply; 5+ messages in thread
From: "Jochen Kühner" @ 2018-08-15 6:27 UTC (permalink / raw)
To: Stefan Beller; +Cc: git, Stefan Beller
We use git for windows, there I cannot fin the git-submodule.sh! How can I fix it there?
Gesendet: Dienstag, 14. August 2018 um 20:22 Uhr
Von: "Stefan Beller" <sbeller@google.com>
An: jochen.kuehner@gmx.de
Cc: git@vger.kernel.org, "Stefan Beller" <sbeller@google.com>
Betreff: [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet
In a56771a668d (builtin/pull: respect verbosity settings in submodules,
2018-01-25), we made sure to pass on both quiet and verbose flag from
builtin/pull.c to the submodule shell script. However git-submodule doesn't
understand a verbose flag, which results in a bug when invoking
git pull --recurse-submodules -v [...]
There are a few different approaches to fix this bug:
1) rewrite 'argv_push_verbosity' or its caller in builtin/pull.c to
cap opt_verbosity at 0. Then 'argv_push_verbosity' would only add
'-q' if any.
2) Have a flag in 'argv_push_verbosity' that specifies if we allow adding
-q or -v (or both).
3) Add -v to git-submodule.sh and make it a no-op
(1) seems like a maintenance burden: What if we add code after
the submodule operations or move submodule operations higher up,
then we have altered the opt_verbosity setting further down the line
in builtin/pull.c.
(2) seems like it could work reasonably well without more regressions
(3) seems easiest to implement as well as actually is a feature with the
last-one-wins rule of passing flags to Git commands.
Signed-off-by: Stefan Beller <sbeller@google.com>
---
On Tue, Aug 14, 2018 at 10:54 AM Jochen Kühner <jochen.kuehner@gmx.de> wrote:
>
> If I set
> git config --global submodule.recurse true
> and run git via:
> git pull --progress -v --no-rebase "origin"
> The command will fail with following output (Errorlevel is 1)
> Fetching submodule submodules/tstemplates
> From http://10.0.102.194:7990/scm/mcc/tstemplates
> = [up to date] feature/robin -> origin/feature/robin
> = [up to date] master -> origin/master
> Already up to date.
> usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
> or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
> or: git submodule [--quiet] init [--] [<path>...]
> or: git submodule [--quiet] deinit [-f|--force] (--all| [--] <path>...)
> or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]
> or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
> or: git submodule [--quiet] foreach [--recursive] <command>
> or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
> or: git submodule [--quiet] absorbgitdirs [--] [<path>...]
>
> seams that the “verbose” parameter “-v” is also sent to “git submodules” wich does not support it.
>
> If I remove “-v” it will work.
>
> Problem is, I use TortoiseGit, wich will automatically create this command!
git-submodule.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/git-submodule.sh b/git-submodule.sh
index 8b5ad59bdee..f7fd80345cd 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -438,6 +438,9 @@ cmd_update()
-q|--quiet)
GIT_QUIET=1
;;
+ -v)
+ GIT_QUIET=0
+ ;;
--progress)
progress=1
;;
--
2.18.0.265.g16de1b435c9.dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet
2018-08-15 6:27 ` Aw: " "Jochen Kühner"
@ 2018-08-15 22:52 ` Stefan Beller
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Beller @ 2018-08-15 22:52 UTC (permalink / raw)
To: jochen.kuehner; +Cc: git
On Tue, Aug 14, 2018 at 11:27 PM "Jochen Kühner" <jochen.kuehner@gmx.de> wrote:
>
>
>
>
> We use git for windows, there I cannot fin the git-submodule.sh! How can I fix it there?
>
>
It probably doesn't have the .sh extension. I don't know where all git
executables are located in GfW.
Maybe "dir /s git.exe" can give you a starting point to look for the
executables of Git.
(courtesy stackoverflow, I am no expert on Windows)
As git-submodule is a shell script and doesn't need compilation, you
can just edit
this in to see if it fixes the problem; mind to use a text editor that
doesn't put CRLF,
but LF line endings only in that file ... shell script is not the most portable.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-08-15 22:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-14 17:54 Bug with Git submodules and submodule.recurse setting Jochen Kühner
2018-08-14 18:22 ` [PATCH] git-submodule.sh: accept verbose flag in cmd_update to be non-quiet Stefan Beller
2018-08-14 18:28 ` Jonathan Nieder
2018-08-15 6:27 ` Aw: " "Jochen Kühner"
2018-08-15 22:52 ` Stefan Beller
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).