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

Re: [PATCH v3 4/4] submodule_needs_pushing() NEEDSWORK when we can not answer this question

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Nov 16, 2016, 14:26 UTC
Message-ID
<20161116142649.GA32087@book.hvoigt.net>
In-Reply-To
<xmqqtwb8s2m8.fsf@gitster.mtv.corp.google.com>
On Tue, Nov 15, 2016 at 04:13:51PM -0800, Junio C Hamano wrote:
Show 15 quoted lines
> Stefan Beller <sbeller@google.com> writes:
> 
> >> "We do not know" ...
> >
> > ... because there is no way to check for us as we don't have the
> > submodule commits.
> >
> >     " We do consider it safe as no one in their sane mind would
> >     have changed the submodule pointers without having the
> >     submodule around. If a user did however change the submodules
> >     without having the submodule commits around, this indicates an
> >     expert who knows what they were doing."
> 
> I didn't think it through myself to arrive at such a conclusion, but
> to me the above sounds like a sensible reasoning [*1*].

I think you have a point here. If I rephrase it like this: "We do consider it safe as no one in their sane mind *could* have changed the submodule pointers without having the submodule around..."

Since its actually hard to create such a situation without the submodule commit around I agree here.

Show 6 quoted lines
> *1* My version was more like "we do not know if they would get into
>     a situation where they do not have enough submodule commits if
>     we pushed our superproject, but more importantly, we DO KNOW
>     that it would not help an iota if we pushed our submodule to
>     them, so there is no point stopping the push of superproject
>     saying 'no, no, no, you must push the submodule first'".

Yes saying that would be wrong. I was rather suggesting that we tell the user that we could not find the submodule commits to and that if he wants to proceed he should either pass --recurse-submodules=no or initialize the submodule.

But I think the above reasoning obsoletes my suggestion. I would adjust the comment accordingly but still keep the patch so we have documentation that this behavior is on purpose.

Cheers Heiko
Previous: Junio C HamanoNext: Stefan Beller
Message 12 of 14 in “Speedup finding of unpushed submodules”
  1. 0/4 Speedup finding of unpushed submodulesHeiko Voigt, Nov 15, 2016
  2. 3/4 batch check whether submodule needs pushing into one callHeiko Voigt, Nov 15, 2016
  3. Stefan BellerNov 15, 2016
  4. Heiko VoigtNov 16, 2016
  5. 2/4 serialize collection of refs that contain submodule changesHeiko Voigt, Nov 15, 2016
  6. Stefan BellerNov 15, 2016
  7. 1/4 serialize collection of changed submodulesHeiko Voigt, Nov 15, 2016
  8. Stefan BellerNov 15, 2016
  9. 4/4 submodule_needs_pushing() NEEDSWORK when we can not answer this questionHeiko Voigt, Nov 15, 2016
  10. Stefan BellerNov 15, 2016
  11. Junio C HamanoNov 16, 2016
  12. Heiko VoigtNov 16, 2016
  13. Stefan BellerNov 15, 2016
  14. Brandon WilliamsNov 15, 2016

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.