git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: push.recurseSubmodules=check doesn't consider tags

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 12, 2019, 17:26 UTC
Message-ID
<xmqqef3yk95i.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<62F6F2E3-FAED-4EE9-BDB8-D484252A845F@arilinc.com>
Scott Johnson <scott.johnson@arilinc.com> 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.

Previous: Scott Johnson
Message 2 of 2 in “push.recurseSubmodules=check doesn't consider tags”
  1. Scott JohnsonJun 12, 2019
  2. Junio C HamanoJun 12, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.