west: west update fails on submodules with relative paths

When west initializes project repository it only adds remote with name specified in west.yml while git assumes that default remote is origin. Relative submodule paths are resolved to default remote. Without origin remote, west update fails while trying to update repository that contains submodules with relative paths, with following warning

warning: could not look up configuration 'remote.origin.url'. Assuming this repository is its own authoritative upstream.

git logic for resolving relative paths can be found here https://github.com/git/git/blob/v2.20.1/builtin/submodule--helper.c#L135 Manually adding origin remote solves the issue. i’d propose west should also add origin remote to projects by default.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 45 (12 by maintainers)

Commits related to this issue

Most upvoted comments

The problem with #546 is that it breaks a guarantee we have had since the beginning, namely that your working tree’s remotes do not matter to west, and you can change them at will. I tried to explain that in https://github.com/zephyrproject-rtos/west/issues/545#issuecomment-937265242. I should have been clearer; this is a blocker for me.

There are some pathological examples (see https://datatracker.ietf.org/doc/html/rfc3986.html#section-5.4 and https://www.rfc-editor.org/errata/eid4547) where git does different things, but in normal cases this seems to work fine as far as I can tell, and even the RFC editors don’t seem to have a good handle on the edge cases.