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

Re: Publishing "filtered branch repositories" - workflow / recommendations?

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 11, 2013, 23:16 UTC
Message-ID
<xmqqa9g7t1vb.fsf@gitster.dls.corp.google.com>
In-Reply-To
<52A8E124.4000002@web.de>
Jens Lehmann <Jens.Lehmann@web.de> writes:
Show 17 quoted lines
>> I think this is closely related to Martin's list of wishes we
>> earlier saw in the thread: remind the user to push necessary
>> submodule tip before the top-level commit that needs that commit in
>> the submodule is pushed out.  Giving projects a way to implement
>> such a policy decision would be good, and having a default policy,
>> if we can find one that would be reasonable for any submodule users,
>> would be even better.  Would adding a generic pre-push hook at the
>> top-level sufficient for that kind of thing, I have to wonder.
>
> That could call "git push --dry-run --recurse-submodules=check" to
> deny the push if the submodule commit isn't on a remote branch.
> that would only work for a single hardcoded remote, as the remote
> itself does not seem to be passed to the pre-push hook.
>
> So me thinks adding a configuration option for the --recurse-submodule
> option of push is the best way to achieve that. This could be set to
> "check" ...

Yes, that uses only a single hard-coded decision, and making the branch name or remote name customizable is not enough, as you are still hardcoding "if ... isn't on" part. It is not far-fetched to imagine a project wants to add more restrictions to what commit in the submodule history can be bound to a tree of a published commit in the top-level project (e.g. "must be a tagged release point", "must be older at least by more than two weeks", "must be signed by one of these developers' keys", etc.).

So I am not yet convinced that a simple "option" that supplies a few parameters to a single hard-coded policy is sufficient in the long run.

Previous: Jens LehmannNext: Heiko Voigt
Message 12 of 13 in “Publishing "filtered branch repositories" - workflow / recommendations?”
  1. Martin LanghoffDec 4, 2013
  2. Martin LanghoffDec 5, 2013
  3. Jens LehmannDec 5, 2013
  4. Martin LanghoffDec 5, 2013
  5. Jens LehmannDec 5, 2013
  6. Martin LanghoffDec 5, 2013
  7. Jens LehmannDec 6, 2013
  8. Martin LanghoffDec 6, 2013
  9. Heiko VoigtDec 9, 2013
  10. Junio C HamanoDec 9, 2013
  11. Jens LehmannDec 11, 2013
  12. Junio C HamanoDec 11, 2013
  13. Heiko VoigtDec 12, 2013

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.