@kira Please correct me if I’ve misinterpreted what you posted however you are suggesting two different methods for properly and completely updating the source tree.
The first method is to do start in the VisionFive2 directory, perform a git pull there to update what is under the Git versioning there and to then go to each subdirectory that is a submodule and perform a git pull there. This would require me to properly identify all of the submodules and cd to the proper directory to do the git pull.
The second method is to start in the VisionFive2 directory, perform a git pull there to update what is under the Git versioning there and to the use a second command, git submodule foreach ‘git pull’, to ask Git to visit each submodule and perform a git pull.
The second method would seem superior since if anyone should know what is a submodule, it should be Git.
I looked at the documentation for the git submodule command at Git - git-submodule Documentation as well as the documentation on submodules at Git - gitsubmodules Documentation to better understand what you are writing.
What I don’t fully understand is the difference between the list of submodules provided by Git with the git submodule command to list the submodules and the complete list of all directories that have a .git file. I would assume that each directory that has a .git file is another Git repository and I would need to do a git pull in that directory to update it.
For example in the following I used the git submodule command to list the submodules for VisionFive2 repository and then used find . -iname “.git” to find all directories that have a .git file in them. The list from the find command has more directories in it, 19 from the find and 5 from the git submodule.
However it may be that the various .git files in the ./buildroot/dl/ tree are temporary and recreated with the next make as are the .git files in the ./work tree. There is no subdirectory named dl in the buildroot repository on GitHub nor is there a work directory in the VisionFive2 repository on GitHub. And I just found the .gitmodules file in the VisionFive2 repository which lists the same 5 submodules reported by git submodules.
rick@rchamber2:~/Documents/starfive/github/VisionFive2$ git submodule foreach 'git pull --dry-run'
Entering 'buildroot'
Entering 'linux'
Entering 'opensbi'
remote: Enumerating objects: 2, done.
remote: Counting objects: 100% (2/2), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 2 (delta 1), reused 1 (delta 0), pack-reused 0
Unpacking objects: 100% (2/2), 245 bytes | 122.00 KiB/s, done.
From https://github.com/starfive-tech/opensbi
* [new tag] JH7110_VF2_515_v3.9.3 -> JH7110_VF2_515_v3.9.3
* [new tag] JH7110_VF2_6.1_v3.9.3 -> JH7110_VF2_6.1_v3.9.3
* [new tag] JH7110_VF2_515_v3.9.3 -> JH7110_VF2_515_v3.9.3
* [new tag] JH7110_VF2_6.1_v3.9.3 -> JH7110_VF2_6.1_v3.9.3
Entering 'soft_3rdpart'
Entering 'u-boot'
remote: Enumerating objects: 2, done.
remote: Counting objects: 100% (2/2), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 2 (delta 1), reused 1 (delta 0), pack-reused 0
Unpacking objects: 100% (2/2), 245 bytes | 245.00 KiB/s, done.
From https://github.com/starfive-tech/u-boot
* [new tag] JH7110_VF2_515_v3.9.3 -> JH7110_VF2_515_v3.9.3
* [new tag] JH7110_VF2_6.1_v3.9.3 -> JH7110_VF2_6.1_v3.9.3
* [new tag] JH7110_VF2_515_v3.9.3 -> JH7110_VF2_515_v3.9.3
* [new tag] JH7110_VF2_6.1_v3.9.3 -> JH7110_VF2_6.1_v3.9.3
rick@rchamber2:~/Documents/starfive/github/VisionFive2$ find . -iname ".git"
./u-boot/.git
./linux/.git
./opensbi/.git
./soft_3rdpart/.git
./buildroot/dl/gst1-interpipe/git/common/.git
./buildroot/dl/gst1-interpipe/git/.git
./buildroot/dl/linux/git/.git
./buildroot/dl/libcamera-apps/git/.git
./buildroot/dl/gst1-shark/git/common/.git
./buildroot/dl/gst1-shark/git/.git
./buildroot/dl/libyuv/git/.git
./buildroot/dl/x264/git/.git
./buildroot/dl/libcamera/git/.git
./buildroot/.git
./.git
./work/buildroot_rootfs/build/gst1-interpipe-1.1.7/common/.git
./work/buildroot_rootfs/build/gst1-shark-v0.7.3/common/.git
./work/buildroot_initramfs/build/gst1-interpipe-1.1.7/common/.git
./work/buildroot_initramfs/build/gst1-shark-v0.7.3/common/.git
rick@rchamber2:~/Documents/starfive/github/VisionFive2$