On Thu, Oct 06, 2022 at 07:54:52PM +0100, Daniel P. Berrangé wrote: > On Thu, Oct 06, 2022 at 07:39:07AM -0400, Michael S. Tsirkin wrote: > > The most commmon complaint about submodules is that > > they don't follow when one switches branches in the > > main repo. Enable recursing into submodules by default > > to address that. > > > > Signed-off-by: Michael S. Tsirkin <m...@redhat.com> > > --- > > .gitmodules | 23 +++++++++++++++++++++++ > > 1 file changed, 23 insertions(+) > > What am I missing, as I tried something equiv to this change > with one submodule and it didn't appear to have any effect. > I started from a clean slate: > > $ git submodule deinit --all --force > > The .gitmodules config has 'recurse = true' for the ui/keycodemapdb > module: > > $ grep keycodemap --after 1 .gitmodules > [submodule "ui/keycodemapdb"] > path = ui/keycodemapdb > url = https://gitlab.com/qemu-project/keycodemapdb.git > recurse = true > > I have a change on master setting the submodule commit: > > $ git show master | grep +Sub > +Subproject commit 7381b9bfadd31c4c9e9a10b5bb5032f9189d4352 > > and check it out: > > $ git submodule update --init ui/keycodemapdb > Submodule 'ui/keycodemapdb' > (https://gitlab.com/qemu-project/keycodemapdb.git) registered for path > 'ui/keycodemapdb' > Submodule path 'ui/keycodemapdb': checked out > '7381b9bfadd31c4c9e9a10b5bb5032f9189d4352' > > > In another branch I have a different commit: > > $ git show sub-foo | grep +Sub > +Subproject commit 57ba70da5312170883a3d622cd2aa3fd0e2ec7ae > > > Now I switch branches and nothing happens, the submodule > is marked as dirty: > > $ git checkout sub-foo > M ui/keycodemapdb > Switched to branch 'sub-foo' > > $ (cd ui/keycodemapdb && git show | head -1) > commit 7381b9bfadd31c4c9e9a10b5bb5032f9189d4352 > > > >From your description (and indeed that of the man page) it > sounded like ui/keycodemapdb should have got updated to > commit 57ba70da5312170883a3d622cd2aa3fd0e2ec7ae when I did > 'git checkout', but that didn't happen
I think .gitmodules got overwritten when you checked out the branch. Possible? > > > > > diff --git a/.gitmodules b/.gitmodules > > index aedd9a03d4..5f32332aff 100644 > > --- a/.gitmodules > > +++ b/.gitmodules > > @@ -1,69 +1,92 @@ > > [submodule "roms/seabios"] > > path = roms/seabios > > + recurse = true > > url = https://gitlab.com/qemu-project/seabios.git/ > > [submodule "roms/SLOF"] > > path = roms/SLOF > > + recurse = true > > url = https://gitlab.com/qemu-project/SLOF.git > > [submodule "roms/ipxe"] > > path = roms/ipxe > > + recurse = true > > url = https://gitlab.com/qemu-project/ipxe.git > > [submodule "roms/openbios"] > > path = roms/openbios > > + recurse = true > > url = https://gitlab.com/qemu-project/openbios.git > > [submodule "roms/qemu-palcode"] > > path = roms/qemu-palcode > > + recurse = true > > url = https://gitlab.com/qemu-project/qemu-palcode.git > > [submodule "roms/sgabios"] > > path = roms/sgabios > > + recurse = true > > url = https://gitlab.com/qemu-project/sgabios.git > > [submodule "dtc"] > > path = dtc > > + recurse = true > > url = https://gitlab.com/qemu-project/dtc.git > > [submodule "roms/u-boot"] > > path = roms/u-boot > > + recurse = true > > url = https://gitlab.com/qemu-project/u-boot.git > > [submodule "roms/skiboot"] > > path = roms/skiboot > > + recurse = true > > url = https://gitlab.com/qemu-project/skiboot.git > > [submodule "roms/QemuMacDrivers"] > > path = roms/QemuMacDrivers > > + recurse = true > > url = https://gitlab.com/qemu-project/QemuMacDrivers.git > > [submodule "ui/keycodemapdb"] > > path = ui/keycodemapdb > > + recurse = true > > url = https://gitlab.com/qemu-project/keycodemapdb.git > > [submodule "roms/seabios-hppa"] > > path = roms/seabios-hppa > > + recurse = true > > url = https://gitlab.com/qemu-project/seabios-hppa.git > > [submodule "roms/u-boot-sam460ex"] > > path = roms/u-boot-sam460ex > > + recurse = true > > url = https://gitlab.com/qemu-project/u-boot-sam460ex.git > > [submodule "tests/fp/berkeley-testfloat-3"] > > path = tests/fp/berkeley-testfloat-3 > > + recurse = true > > url = https://gitlab.com/qemu-project/berkeley-testfloat-3.git > > [submodule "tests/fp/berkeley-softfloat-3"] > > path = tests/fp/berkeley-softfloat-3 > > + recurse = true > > url = https://gitlab.com/qemu-project/berkeley-softfloat-3.git > > [submodule "roms/edk2"] > > path = roms/edk2 > > + recurse = true > > url = https://gitlab.com/qemu-project/edk2.git > > [submodule "slirp"] > > path = slirp > > + recurse = true > > url = https://gitlab.com/qemu-project/libslirp.git > > [submodule "roms/opensbi"] > > path = roms/opensbi > > + recurse = true > > url = https://gitlab.com/qemu-project/opensbi.git > > [submodule "roms/qboot"] > > path = roms/qboot > > + recurse = true > > url = https://gitlab.com/qemu-project/qboot.git > > [submodule "meson"] > > path = meson > > + recurse = true > > url = https://gitlab.com/qemu-project/meson.git > > [submodule "roms/vbootrom"] > > path = roms/vbootrom > > + recurse = true > > url = https://gitlab.com/qemu-project/vbootrom.git > > [submodule "tests/lcitool/libvirt-ci"] > > path = tests/lcitool/libvirt-ci > > + recurse = true > > url = https://gitlab.com/libvirt/libvirt-ci.git > > [submodule "subprojects/libvfio-user"] > > path = subprojects/libvfio-user > > + recurse = true > > url = https://gitlab.com/qemu-project/libvfio-user.git > > -- > > MST > > > > With regards, > Daniel > -- > |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| > |: https://libvirt.org -o- https://fstop138.berrange.com :| > |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|