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

Re: [RFC PATCH 2/2] push: support pushing to a remote group

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 9, 2026, 13:38 UTC
Message-ID
<xmqqzf4h6s3b.fsf@gitster.g>
In-Reply-To
<CAPSxiM_KVU7rE49=omWUwaYS-u_J6eQPDgTRjPop1gj6BM1qKQ@mail.gmail.com>
Usman Akinyemi <usmanakinyemi202@gmail.com> writes:
Show 20 quoted lines
> Also, in the cover letter, I asked some questions. I think you might
> have missed it.
>
> Quoting here again:
> "
>   - push.default = simple interacts poorly with group pushes when the
>     current branch has no upstream set, since setup_default_push_refspecs()
>     will die on the first remote that is not the upstream. Users should
>     use push.default = current or explicit refspecs for group pushes.
>     It is worth discussing whether the group push path should automatically
>     imply push.default = current, or whether a clear error message
>     directing the user to configure this would be sufficient.
>
>   - force-with-lease semantics across a group push are currently
>     unmodified — the same CAS constraints are forwarded to every remote
>     in the group. Whether this is the right behaviour or whether
>     per-remote lease tracking is needed is an open question.
> "
>
> I will want feedback on this also.

Quite honestly, I do not have strong opinions on either of these points, primarily because the answer would become self evident if we follow a simple general principle to explain this feature to end users, which is:

When you have N remotes r1, r2, ..., rN, and a remote group G that expands (possibly recursively) to these N remotes, then for any and all values of $options and $args, this command invocation

    $ git push $options G $args
should mean exactly the same thing as
    $ git push $options r1 $args
    $ git push $options r2 $args
    ...
    $ git push $options rN $args
So the answer to the first one would be:
    "git push r1" (without any other parameters) may work while "git
    push r2" (the same, wihtout any other parameters) may fail,
    depending on how the push.default is set and on what branch you
    run these two pushes.  "git push G" should behave the same way.
    There is nothing extra fancy needs to be done.  If the user
    wants to push to these N remotes as a whole in an identical way
    by using remote group G, they are the one who is responsible to
    make this sequences of pushes "git push r1; git push r2; ..."
    make sense.

The answer to the second one would be derived the same way. If $options includes the "--force-with-lease=<commit>", then the command should behave as if copies of the command that pushes to these N remotes, "git push --force-with-lease=<commit> r$i", are invoked. If <commit> is not given (which is not a recommended even for pushes to a single remote, because with background fetching, guesses based on the remote-tracking branches are never be reliable), the command may guess what commit to expect on the remote the same way as if these N independent pushes are made without using group feature (which of course may make different guesses for each remote, if their remote-tracking branches are pointing at different commits).

Previous: Usman AkinyemiNext: Usman Akinyemi
Message 8 of 39 in “push: add support for pushing to remote groups”
  1. 0/2 push: add support for pushing to remote groupsUsman Akinyemi, Mar 5, 2026
  2. 1/2 remote: move remote group resolution to remote.cUsman Akinyemi, Mar 5, 2026
  3. Junio C HamanoMar 6, 2026
  4. Usman AkinyemiMar 9, 2026
  5. 2/2 push: support pushing to a remote groupUsman Akinyemi, Mar 5, 2026
  6. Junio C HamanoMar 7, 2026
  7. Usman AkinyemiMar 9, 2026
  8. Junio C HamanoMar 9, 2026
  9. 0/2 push: add support for pushing to remote groupsUsman Akinyemi, Mar 18, 2026
  10. 1/2 remote: move remote group resolution to remote.cUsman Akinyemi, Mar 18, 2026
  11. 2/2 push: support pushing to a remote groupUsman Akinyemi, Mar 18, 2026
  12. Junio C HamanoMar 18, 2026
  13. Junio C HamanoMar 18, 2026
  14. Junio C HamanoMar 18, 2026
  15. Junio C HamanoMar 19, 2026
  16. Usman AkinyemiMar 25, 2026
  17. Junio C HamanoMar 18, 2026
  18. Usman AkinyemiMar 18, 2026
  19. 0/2 push: add support for pushing to remote groupsUsman Akinyemi, Mar 25, 2026
  20. 1/2 remote: move remote group resolution to remote.cUsman Akinyemi, Mar 25, 2026
  21. 2/2 push: support pushing to a remote groupUsman Akinyemi, Mar 25, 2026
  22. Junio C HamanoMar 25, 2026
  23. Usman AkinyemiMar 31, 2026
  24. Usman AkinyemiMar 31, 2026
  25. Junio C HamanoApr 1, 2026
  26. Junio C HamanoMar 27, 2026
  27. 0/2 push: add support for pushing to remote groupsUsman Akinyemi, Apr 27, 2026
  28. 1/2 remote: move remote group resolution to remote.cUsman Akinyemi, Apr 27, 2026
  29. 2/2 push: support pushing to a remote groupUsman Akinyemi, Apr 27, 2026
  30. Junio C HamanoApr 28, 2026
  31. 0/3 push: add support for pushing to remote groupsUsman Akinyemi, May 3, 2026
  32. 1/3 remote: fix sign-compare warnings in push_cas_optionUsman Akinyemi, May 3, 2026
  33. 2/3 remote: move remote group resolution to remote.cUsman Akinyemi, May 3, 2026
  34. 3/3 push: support pushing to a remote groupUsman Akinyemi, May 3, 2026
  35. Kristoffer HaugsbakkMay 12, 2026
  36. 0/3 push: add support for pushing to remote groupsUsman Akinyemi, May 18, 2026
  37. 1/3 remote: fix sign-compare warnings in push_cas_optionUsman Akinyemi, May 18, 2026
  38. 2/3 remote: move remote group resolution to remote.cUsman Akinyemi, May 18, 2026
  39. 3/3 push: support pushing to a remote groupUsman Akinyemi, May 18, 2026

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.