git-bump ambiguous name
Currently, if there are two submodules and the name of one submodule is a substring of the second submodule, the script will fail due to name ambiguity. Example:
- submodules
VTK
andVTKStreaming
-
git bump VTK master
returns "Submodule name ambiguous, aborting" because
config="$( git config --local --get-regexp "submodule\..*$submodule.*\.url" )"
in line 64 of git-bump
matches both of them .
How about instead of allowing 0 or more characters after $submodule
, require at least a path separator /
or .
?
config="$( git config --local --get-regexp "submodule\..*$submodule[\/|\.]+.*url" )"
this solves the above issue while still allowing to use directories to refer to submodules e.g. for
submodule.ThirdParty/IceT/vtkicet.url
both IceT
and icet
will work.
More examples to try at https://regex101.com/r/ZY1IN9/1
Edited by Christos Tsolakis