From: Junio C Hamano <gitster@pobox.com>
To: Usman Akinyemi <usmanakinyemi202@gmail.com>
Cc: git@vger.kernel.org, christian.couder@gmail.com,
me@ttaylorr.com, phillip.wood123@gmail.com, ps@pks.im
Subject: Re: [RFC PATCH v2 2/2] push: support pushing to a remote group
Date: Wed, 18 Mar 2026 13:57:48 -0700 [thread overview]
Message-ID: <xmqqpl50q2ib.fsf@gitster.g> (raw)
In-Reply-To: <20260318204028.1010487-3-usmanakinyemi202@gmail.com> (Usman Akinyemi's message of "Thu, 19 Mar 2026 02:10:28 +0530")
Usman Akinyemi <usmanakinyemi202@gmail.com> writes:
> A known interaction: push.default = simple will die when the current
> branch has no upstream configured, because setup_default_push_refspecs()
> requires an upstream for that mode. Users pushing to a group should set
> push.default = current or supply explicit refspecs. This is consistent
> with how fetch handles default refspec resolution per remote.
Even if you are not pushing to a group but to a single remote,
default=simple would die when the current branch has no upstream
configured, so I do not know what the point of singling
"default=simple" out is in the above paragraph. For that matter, is
"default=current" so special and would it be the only way, other
than giving an explicit refspec, to make the push succeed? Wouldn't
default=matching, for example, work equally well?
> +When a group name is given as the `<repository>` argument, the push is
> +performed to each member remote in turn. The defining principle is:
> +
> + git push <options> all-remotes <args>
> +
> +is exactly equivalent to:
> +
> + git push <options> r1 <args>
> + git push <options> r2 <args>
> + ...
> + git push <options> rN <args>
> +
> +where r1, r2, ..., rN are the members of `all-remotes`. No special
> +behaviour is added or removed — the group is purely a shorthand for
> +running the same push command against each member remote individually.
One thing this does not make it clear is if we abort upon the first
failure, or even after some fail we still attempt to push to the
rest of the remotes in the group.
> +Similarly, if `--force-with-lease` is given without an explicit expected
> +commit, Git will guess the expected commit for each remote independently
> +from that remote's own remote-tracking branch, the same way it would if
> +each push were run separately.
Understandable (even though it would be obvious from the "exactly
equivalent to" above).
> If an explicit commit is given with
> +`--force-with-lease=<refname>:<expect>`, that same value is forwarded
> +to every member remote, as if each of
> +`git push --force-with-lease=<refname>:<expect> r1`,
> +`git push --force-with-lease=<refname>:<expect> r2`, ...,
> +`git push --force-with-lease=<refname>:<expect> rN` had been invoked.
Understandable (ditto).
> diff --git a/builtin/push.c b/builtin/push.c
> index 5b6cebbb85..33de769a33 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -542,7 +542,6 @@ static int git_push_config(const char *k, const char *v,
>
> return git_default_config(k, v, ctx, NULL);
> }
> -
> int cmd_push(int argc,
> const char **argv,
> const char *prefix,
You didn't want to include this hunk, I presume?
Thanks.
next prev parent reply other threads:[~2026-03-18 20:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 22:32 [RFC PATCH 0/2] push: add support for pushing to remote groups Usman Akinyemi
2026-03-05 22:32 ` [RFC PATCH 1/2] remote: move remote group resolution to remote.c Usman Akinyemi
2026-03-06 18:12 ` Junio C Hamano
2026-03-09 0:43 ` Usman Akinyemi
2026-03-05 22:32 ` [RFC PATCH 2/2] push: support pushing to a remote group Usman Akinyemi
2026-03-07 2:12 ` Junio C Hamano
2026-03-09 0:56 ` Usman Akinyemi
2026-03-09 13:38 ` Junio C Hamano
2026-03-18 20:40 ` [RFC PATCH v2 0/2] push: add support for pushing to remote groups Usman Akinyemi
2026-03-18 20:40 ` [RFC PATCH v2 1/2] remote: move remote group resolution to remote.c Usman Akinyemi
2026-03-18 20:40 ` [RFC PATCH v2 2/2] push: support pushing to a remote group Usman Akinyemi
2026-03-18 20:57 ` Junio C Hamano [this message]
2026-03-18 21:58 ` Junio C Hamano
2026-03-18 22:25 ` Junio C Hamano
2026-03-19 17:02 ` Junio C Hamano
2026-03-25 18:42 ` Usman Akinyemi
2026-03-18 21:57 ` [RFC PATCH v2 0/2] push: add support for pushing to remote groups Junio C Hamano
2026-03-18 23:13 ` Usman Akinyemi
2026-03-25 19:09 ` [RFC PATCH v3 " Usman Akinyemi
2026-03-25 19:09 ` [RFC PATCH v3 1/2] remote: move remote group resolution to remote.c Usman Akinyemi
2026-03-25 19:09 ` [RFC PATCH v3 2/2] push: support pushing to a remote group Usman Akinyemi
2026-03-25 19:47 ` Junio C Hamano
2026-03-27 22:18 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqpl50q2ib.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=phillip.wood123@gmail.com \
--cc=ps@pks.im \
--cc=usmanakinyemi202@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox