From: Junio C Hamano <gitster@pobox.com>
To: "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Harald Nordgren <haraldnordgren@gmail.com>
Subject: Re: [PATCH 1/2] remote: pass repository to push tracking helper
Date: Mon, 20 Jul 2026 11:23:10 -0700 [thread overview]
Message-ID: <xmqqfr1dcygh.fsf@gitster.g> (raw)
In-Reply-To: <fc70895732f406ecdbaea7a5b9a3fda4fb03df67.1784538618.git.gitgitgadget@gmail.com> (Harald Nordgren via GitGitGadget's message of "Mon, 20 Jul 2026 09:10:17 +0000")
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> The push tracking helper currently only needs the push remote. However,
> resolving a URL-valued remote requires access to the repository's list
> of configured remotes.
It is unclear to me what 'resolving a URL-valued remote' means.
Could you describe what you are trying to achieve, without relying
on unexplained terms like 'to resolve' and 'URL-valued remote',
which seem to carry specialized meanings in this context?
Thanks.
> Pass the repository through the existing callers and mark the parameter
> as unused for now. This prepares the helper for that lookup without
> changing its behavior.
>
> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
> remote.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/remote.c b/remote.c
> index e6c52c850c..89d0f9e2d8 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -1887,7 +1887,8 @@ const char *branch_get_upstream(struct branch *branch, struct strbuf *err)
> return branch->merge[0]->dst;
> }
>
> -static char *tracking_for_push_dest(struct remote *remote,
> +static char *tracking_for_push_dest(struct repository *repo UNUSED,
> + struct remote *remote,
> const char *refname,
> struct strbuf *err)
> {
> @@ -1925,13 +1926,13 @@ static char *branch_get_push_1(struct repository *repo,
> _("push refspecs for '%s' do not include '%s'"),
> remote->name, branch->name);
>
> - ret = tracking_for_push_dest(remote, dst, err);
> + ret = tracking_for_push_dest(repo, remote, dst, err);
> free(dst);
> return ret;
> }
>
> if (remote->mirror)
> - return tracking_for_push_dest(remote, branch->refname, err);
> + return tracking_for_push_dest(repo, remote, branch->refname, err);
>
> switch (push_default) {
> case PUSH_DEFAULT_NOTHING:
> @@ -1939,7 +1940,7 @@ static char *branch_get_push_1(struct repository *repo,
>
> case PUSH_DEFAULT_MATCHING:
> case PUSH_DEFAULT_CURRENT:
> - return tracking_for_push_dest(remote, branch->refname, err);
> + return tracking_for_push_dest(repo, remote, branch->refname, err);
>
> case PUSH_DEFAULT_UPSTREAM:
> return xstrdup_or_null(branch_get_upstream(branch, err));
> @@ -1953,7 +1954,7 @@ static char *branch_get_push_1(struct repository *repo,
> up = branch_get_upstream(branch, err);
> if (!up)
> return NULL;
> - cur = tracking_for_push_dest(remote, branch->refname, err);
> + cur = tracking_for_push_dest(repo, remote, branch->refname, err);
> if (!cur)
> return NULL;
> if (strcmp(cur, up)) {
next prev parent reply other threads:[~2026-07-20 18:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 9:10 [PATCH 0/2] remote: resolve url push tracking Harald Nordgren via GitGitGadget
2026-07-20 9:10 ` [PATCH 1/2] remote: pass repository to push tracking helper Harald Nordgren via GitGitGadget
2026-07-20 18:23 ` Junio C Hamano [this message]
2026-07-20 9:10 ` [PATCH 2/2] remote: resolve URL-valued push tracking remotes Harald Nordgren via GitGitGadget
2026-07-20 18:49 ` Junio C Hamano
2026-07-20 19:56 ` Harald Nordgren
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=xmqqfr1dcygh.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=haraldnordgren@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.