Git windows 2.22.0 breaks with submodule add
The traceback below shows that git for windows has become pickier
in the latest release (2.22.0). It appears it will no longer accept git
submodule -b
This works fine in 'git version 2.21.0.windows.1'.
========================================
gt.submodule('add','../../utils',b='master')
\Python36\lib\site-packages\git\cmd.py", line 548, in
Same on linux:
user@54a7984eef0c:/tmp$ git submodule -b master add ../../utils
usage: git submodule [--quiet] [--cached]
or: 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] set-branch (--default|--branch <branch>) [--] <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>...]
user@54a7984eef0c:/tmp$ git submodule add -b master ../../utils
fatal: repository 'utils' does not exist
fatal: clone of 'utils' into submodule path '/tmp/utils' failed
Note the first invocation is a usage error (showing the original issue reported for Windows is present on Linux); the second one got past that and errored out for a different (and expected) reason.
@georgealverson could you post the complete stack trace so we can see where it originates from?
Hi,
The pertinent section is marked below with '>>>'.
I haven't checked under Linux, but I believe your example should not work unless you have an available repo under ../../utils. That's what the error message seems to indicate.
Best, George
Traceback (most recent call last):
File "C:\Users\galve\source\repos\CMS Python Scripts\Scripts\CmsNotes.py", line 1517, in
gt.submodule('add','../../utils',b='master')
File "C:\Users\galve\AppData\Local\Programs\Python\Python36\lib\site-packages\git\cmd.py", line 548, in
Actually, what I posted clearly shows one way is a usage error and the other way is as you said, but it proves the change to a more strict command line processing in git.
Yes, of course. Always read to the end of the message!