From: Junio C Hamano Date: Wed, 12 Jun 2019 17:26:01 GMT Subject: Re: push.recurseSubmodules=check doesn't consider tags Message-ID: In-Reply-To: <62F6F2E3-FAED-4EE9-BDB8-D484252A845F@arilinc.com> Scott Johnson writes: > I occasionally rebase my submodules. I realize the danger (historical submodule pointers could point to commits that get garbage-collected away) so I always create and push a tag before the rebase, to make sure the old commits will never get purged. I believe this is safe, based on some experiments I’ve run. > > The issue: I set the config var push.recurseSubmodules=check, and > it seems to insist on having a branch and not merely a tag. I suspect that this is pretty much by design. When deciding if it needs a push in a submodule repository, submodule.c::submodule_needs_pushing() gets called and asked to check what is available at the remote without actually making a connection to the other side. It is done by looking at the remote-tracking branches in the copy of the submodule repository we have locally. As there is no "remote-tracking tags" (iow, you cannot tell from the output of "git -C submodule tag -l" if each of the tags you have locally in your copy of the submodule exists in another repository you push to and fetch from), this process does not look at refs/tags/ hierarchy of your copy of the submodule repository and that is quite deliberate, I would think.