Created attachment 5127 [details] My bugfix based on yocto-5.0.8 The devtool upgrade command fails while it goes through a git submodule directory. It happens when devtool executes 'git rev-list devtool-base..<submodule commit hash>'. The debug log shows that 'git rev-list' is called from parent directory but with the commit hash of the submodule which does not exist there ("amqp-proxy" is the parent git repo and "contracts" the submodule): -- snipped -- DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git fetch DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git checkout 35b87c6723cf5afbee0cf02c7447eb8c833185af DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git tag -f devtool-base-new DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git submodule update --recursive DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git submodule foreach 'git tag -f devtool-base-new' DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git submodule --quiet foreach 'echo $sm_path' DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git branch -r --contains 35b87c6723cf5afbee0cf02c7447eb8c833185af DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git rev-parse HEAD DEBUG: Running command <build_path>/workspace/sources/amqp-proxy/contracts> git rev-parse HEAD DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git checkout devtool-patched -b devtool DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git branch --list devtool-override-* DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git rev-list devtool-base..35b87c6723cf5afbee0cf02c7447eb8c833185af INFO: Rebasing devtool onto 35b87c6723cf5afbee0cf02c7447eb8c833185af DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git checkout devtool DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git rebase 35b87c6723cf5afbee0cf02c7447eb8c833185af DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git rev-list devtool-base..35b87c6723cf5afbee0cf02c7447eb8c833185af DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git checkout devtool DEBUG: Running command <build_path>/workspace/sources/amqp-proxy/contracts> git checkout devtool-patched -b devtool DEBUG: Running command <build_path>/workspace/sources/amqp-proxy/contracts> git branch --list devtool-override-* DEBUG: Running command <build_path>/workspace/sources/amqp-proxy> git rev-list devtool-base..90727cda36bab25fb106fc100e5a6177467f5456 ERROR: Execution of 'git rev-list devtool-base..90727cda36bab25fb106fc100e5a6177467f5456' failed with exit code 128: fatal: Invalid revision range devtool-base..90727cda36bab25fb106fc100e5a6177467f5456 -- snipped end -- The full command that was executed for this output is 'command: devtool -d upgrade amqp-proxy'. The related recipe uses "gitsm://" for fetching the code. After inspecting the related code in 'poky/scripts/lib/devtool/upgrade.py' I have found a working fix for me. See attached patch, based on yocto 5.0.8. Hope this helps. Conclusion: Is seems that the path argument is missing when running the 'git rev-list' calls from submodule directories. However, because I have found the same (unfixed) code in master branch and have not found a bug report for this issue yet (the affected code was add around a year ago), I am not sure if the implementation is intended and I am somehow terribly wrong with what I am doing...
"oe-selftest -r devtool" has a lot of selftests for devtool. Would you be able to write a test case which covers this scenario? If so, at a quick glance, I think your patch seems reasonable and you could send that for review too?
(In reply to Richard Purdie from comment #1) > "oe-selftest -r devtool" has a lot of selftests for devtool. Would you be > able to write a test case which covers this scenario? I think so... After a quick glance inside the test code I got an idea where to look next^^. However, it may take a while but I will get used to it. > If so, at a quick > glance, I think your patch seems reasonable and you could send that for > review too? Sure, I will do that.
Fixed in 4c7b0007327d592b8f5d1f50ebb0325dc483bd87 (https://git.yoctoproject.org/poky/commit/?id=4c7b0007327d592b8f5d1f50ebb0325dc483bd87)
The requested test case can be found in 921faf324658371193b1f0847ebc1912d7fef25d (https://git.yoctoproject.org/poky/commit/?id=921faf324658371193b1f0847ebc1912d7fef25d)
fixed