When executing orc update, an AttributeError: 'NoneType' object has no attribute 'group' is thrown here:
|
base_url = os.path.dirname(match.group("url")) |
when the user git configuration contains something like this:
[includeIf "hasconfig:remote.*.url:https://example.com*/**"]
path = .gitconfig-example
in their ~/.gitconfig file. This happens, because orchestra runs git -C .orchestra config --get-regexp 'remote\.[^.]*\.url', which outputs these configuration directives, because they match the remote\.[^.]*\.url regex:
includeif.hasconfig:remote.*.url:https://example.com*/**.path .gitconfig-example
remote.origin.url https://github.com/revng/orchestra
Subsequently, the regex mactch of remote\.(?P<name>[^.]*)\.url (?P<url>.*)$ on the first line fails, causing match to become None.
|
remotes_re = re.compile(r"remote\.(?P<name>[^.]*)\.url (?P<url>.*)$") |
|
|
|
remotes = {} |
|
for line in git_output.splitlines(keepends=False): |
|
match = remotes_re.match(line) |
A quick-fix would be to just discard lines that don't match:
if match is None:
continue
But imho the general approach should be reconsidered. This seems very britle, as it relies on multiple regular expressions and a subprocess invocation.
When executing
orc update, anAttributeError: 'NoneType' object has no attribute 'group'is thrown here:revng-orchestra/orchestra/model/configuration/configuration.py
Line 232 in 4396054
when the user git configuration contains something like this:
in their
~/.gitconfigfile. This happens, because orchestra runsgit -C .orchestra config --get-regexp 'remote\.[^.]*\.url', which outputs these configuration directives, because they match theremote\.[^.]*\.urlregex:Subsequently, the regex mactch of
remote\.(?P<name>[^.]*)\.url (?P<url>.*)$on the first line fails, causingmatchto becomeNone.revng-orchestra/orchestra/model/configuration/configuration.py
Lines 227 to 231 in 4396054
A quick-fix would be to just discard lines that don't match:
But imho the general approach should be reconsidered. This seems very britle, as it relies on multiple regular expressions and a subprocess invocation.