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

Re: Synchronous replication on push

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 2, 2024, 14:49 UTC
Message-ID
<ZyY74N_NjmaJ2677@tapette.crustytoothpaste.net>
In-Reply-To
<20241102133511.6375B609AC@jupiter.mumble.net>
On 2024-11-02 at 13:35:11, Taylor R Campbell wrote:
Show 5 quoted lines
> I'm asking about how to configure a _single_ frontend remote, from the
> perspective of developers who are pushing from their development
> workstations, so that it replicates to one or many backend stores.
> This is, for example, the usage model of Github's proprietary
> implementation.

I don't think there's built-in functionality for this and I'm not sure that it can be done without additional software.

If you really wanted to try to do this with out of the box Git, you could create a `pre-receive` hook that did policy controls and then on success, took all of the objects from the quarantine and rsynced them (without overwriting) to the remote store, and then use the `reference-transaction` hook to replicate the reference transaction to the remote side via SSH or something. I haven't tested this, so it might or might not work, but you could try it.

Note that GitHub has a separate service that does the replication and intercepts the ref update to send it through the three-phase commit, so they don't rely on features of core Git to implement this functionality.

-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
Previous: Taylor R CampbellNext: Taylor R Campbell
Message 4 of 10 in “Synchronous replication on push”
  1. Taylor R CampbellNov 2, 2024
  2. Matěj CeplNov 2, 2024
  3. Taylor R CampbellNov 2, 2024
  4. brian m. carlsonNov 2, 2024
  5. Taylor R CampbellNov 4, 2024
  6. Konstantin RyabitsevNov 4, 2024
  7. Taylor R CampbellNov 4, 2024
  8. brian m. carlsonNov 4, 2024
  9. Jeff KingNov 4, 2024
  10. Taylor R CampbellNov 5, 2024

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.