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

Re: [PATCH] push: do not add submodule odb as an alternate when recursing on demand

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 16, 2017, 00:11 UTC
Message-ID
<xmqqd17wpe14.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kag+U94tzJ14mB4VZjSZ2MtUJ4vu4MXKLKkpkLw=2K_NA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 11 quoted lines
>> Is "is it populated" a good thing to check here, though?  IIRC,
>> add-submodule-odb allows you to add the object database of an
>> inactivated submodule, so this seems to change the behaviour.  I do
>> not know if the behaviour change is a good thing (i.e. bugfix) or
>> not (i.e. regression) offhand, though.
>
> Good point, we should be able to push non-populated, even inactive(?)
> submodules. For that we strictly need add_submodule_odb here
> (or the repo object of the submodule, eventually).
>
> So let's retract this patch for now.
Not so fast.  

I am not convinced "push --recursive" should touch a submodule that was once cloned from the upstream and then deactivated, so using add-submodule-odb to decide if the push should go through may be a bug that we may want to fix, in which case the diff of the patch in question may be good as-is. We need to sell it as a bugfix to the users, who may complain about behaviour change (if there is one).

On the other hand, even if it were desirable for such a deactivated submodule to be pushed, as your log message explained, there is no reason to contaminate the in-core object hash by calling the add-submodule-odb helper, when the only thing we care about is "do we have the refs and object store for this submodule? we do not care if it is activated or not". Perhaps there is a more appropriate helper in submodule.c that answers that question that we should be using instead of add-submodule-odb, and if there is not yet such a helper, perhaps this indicates that we need to add such a helper, which essentially is the early half of what add-submodule-odb does, i.e. ask git_path_submodule() for the object store and check if that directory exists.

Thanks.
Previous: Stefan BellerNext: Stefan Beller
Message 16 of 20 in “submodule: use cheaper check for submodule pushes”
  1. submodule: use cheaper check for submodule pushesStefan Beller, Jul 12, 2017
  2. Jonathan NiederJul 13, 2017
  3. Stefan BellerJul 13, 2017
  4. Junio C HamanoJul 13, 2017
  5. Stefan BellerJul 13, 2017
  6. Junio C HamanoJul 13, 2017
  7. Stefan BellerJul 13, 2017
  8. Jonathan NiederJul 13, 2017
  9. Stefan BellerJul 13, 2017
  10. push: do not add submodule odb as an alternate when recursing on demandStefan Beller, Aug 15, 2017
  11. Jonathan NiederAug 15, 2017
  12. Jonathan NiederAug 15, 2017
  13. Stefan BellerAug 15, 2017
  14. Junio C HamanoAug 15, 2017
  15. Stefan BellerAug 15, 2017
  16. Junio C HamanoAug 16, 2017
  17. Stefan BellerAug 16, 2017
  18. Jonathan NiederAug 16, 2017
  19. Stefan BellerAug 16, 2017
  20. Heiko VoigtAug 16, 2017

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.