qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH] gitmodules: recurse by default
Date: Fri, 7 Oct 2022 12:09:40 +0100	[thread overview]
Message-ID: <Y0AI9G66wl/+vVMB@redhat.com> (raw)
In-Reply-To: <Y0ADZAQbjIJMVzXp@redhat.com>

On Fri, Oct 07, 2022 at 11:45:56AM +0100, Daniel P. Berrangé wrote:
> On Fri, Oct 07, 2022 at 06:11:25AM -0400, Michael S. Tsirkin wrote:
> > On Fri, Oct 07, 2022 at 09:07:17AM +0100, Daniel P. Berrangé wrote:
> > > On Thu, Oct 06, 2022 at 08:24:01PM -0400, Michael S. Tsirkin wrote:
> > > > 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 <mst@redhat.com>
> > > > > > ---
> > > > > >  .gitmodules | 23 +++++++++++++++++++++++
> > > > > >  1 file changed, 23 insertions(+)

snip

> > I just retested and it's not working for me either :(
> > I was sure it worked but I guess the testing wasn't done properly.
> > Back to the drawing board sorry.
> 
> I think the problem is that this setting doesn't apply in the context
> of .gitmodules. Various commands take a '--recurse-submodules' parameter,
> and like many params this can be set in the .git/config file. The
> problem is .git/config isn't a file we can influence automatically,
> it is upto the dev to set things for every clone they do :-(

With the correct setting in my .git/config, I've just discovered
an unexpected & undesirable consequence of using recurse=true.
It affects the 'push' command. If your submodule contains a hash
that is not present in the upstream of the submodule, then when
you try to push, it will also try to push the submodule change.

eg, I have a qemu.git branch 'work' and i made a change to
ui/keycodemapdb. If I try to push to my gitlab fork, whose
remote I called 'gitlab', then it will also try to push
ui/keycodemapdb to a fork called 'gitlab'.  Except I don't
have any such fork existing, so my attempt to push my qemu.git
changes fails because of the submodule.

This is going to be annoying to people who are working on branches
with updates to the git submodules if we were to set recurse=true
by default, as they'll have to also setup remotes for submodules
they work on.

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 :|



  reply	other threads:[~2022-10-07 13:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 11:39 [PATCH] gitmodules: recurse by default Michael S. Tsirkin
2022-10-06 13:02 ` Peter Maydell
2022-10-06 14:30   ` Michael S. Tsirkin
2022-10-06 15:10 ` Philippe Mathieu-Daudé via
2022-10-06 15:23   ` Peter Maydell
2022-10-06 15:29   ` Michael S. Tsirkin
2022-10-06 18:54 ` Daniel P. Berrangé
2022-10-07  0:24   ` Michael S. Tsirkin
2022-10-07  8:07     ` Daniel P. Berrangé
2022-10-07 10:11       ` Michael S. Tsirkin
2022-10-07 10:45         ` Daniel P. Berrangé
2022-10-07 11:09           ` Daniel P. Berrangé [this message]
2022-10-11 22:32             ` Michael S. Tsirkin
2022-10-12  7:51               ` Daniel P. Berrangé
2022-10-12 11:31                 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y0AI9G66wl/+vVMB@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).