From: "Shawn O. Pearce" <spearce@spearce.org>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: Git List <git@vger.kernel.org>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Daniel Barkalow <barkalow@iabervon.org>,
Johan Herland <johan@herland.net>
Subject: Re: [PATCH 7/7] Factor ref updating out of fetch_with_import
Date: Thu, 29 Oct 2009 07:22:32 -0700 [thread overview]
Message-ID: <20091029142232.GS10505@spearce.org> (raw)
In-Reply-To: <1256798426-21816-8-git-send-email-srabbelier@gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> wrote:
> Also allow the new update_refs to actually update the refs set, this
> way the remote helper can set the value of previously unknown refs.
...
> diff --git a/builtin-clone.c b/builtin-clone.c
> index f281756..768668d 100644
> --- a/builtin-clone.c
> +++ b/builtin-clone.c
> @@ -512,6 +512,13 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
> if (refs) {
> struct ref *ref_cpy = copy_ref_list(refs);
> transport_fetch_refs(transport, ref_cpy);
> + if (transport->update_refs)
> + {
> + ref_cpy = copy_ref_list(refs);
> + transport->update_refs(transport, ref_cpy);
Please define a transport_update_refs wrapper function to implement
this method invocation on the transport instance. Callers should
not be reaching into the struct transport directly.
> diff --git a/builtin-fetch.c b/builtin-fetch.c
> index 63a4ff0..3aaac47 100644
> --- a/builtin-fetch.c
> +++ b/builtin-fetch.c
> @@ -479,7 +479,11 @@ static int fetch_refs(struct transport *transport, struct ref *ref_map)
> {
> int ret = quickfetch(ref_map);
> if (ret)
> + {
> ret = transport_fetch_refs(transport, ref_map);
> + if (transport->update_refs)
> + transport->update_refs(transport, ref_map);
I certainly have to wonder... if this is done in both fetch and
clone, why isn't it just part of fetch_refs?
> diff --git a/transport-helper.c b/transport-helper.c
> index a361366..9a98fae 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
> @@ -264,5 +271,6 @@ int transport_helper_init(struct transport *transport, const char *name)
> transport->get_refs_list = get_refs_list;
> transport->fetch = fetch;
> transport->disconnect = release_helper;
> + transport->update_refs = update_refs;
Please set this before the disconnect method (move it up one line).
--
Shawn.
next prev parent reply other threads:[~2009-10-29 14:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-29 6:40 [PATCH 0/7] Prepare git-remote-helpers series for hg support Sverre Rabbelier
2009-10-29 6:40 ` [PATCH 2/7] .gitignore: add git-remote-cvs Sverre Rabbelier
2009-10-29 6:40 ` [PATCH 3/7] Add notify and warn to util.py Sverre Rabbelier
2009-10-29 6:40 ` [PATCH 4/7] Allow both url and foreign vcs in remote config Sverre Rabbelier
2009-10-29 6:40 ` [PATCH 5/7] Finally make remote helper support useful Sverre Rabbelier
2009-10-29 6:40 ` [PATCH 6/7] When updating refs after a fetch, resolve the symref if set Sverre Rabbelier
2009-10-29 6:40 ` [PATCH 7/7] Factor ref updating out of fetch_with_import Sverre Rabbelier
2009-10-29 14:22 ` Shawn O. Pearce [this message]
2009-10-29 15:53 ` Sverre Rabbelier
2009-10-29 15:56 ` Shawn O. Pearce
2009-10-29 16:32 ` Sverre Rabbelier
2009-10-29 17:22 ` Daniel Barkalow
2009-10-29 17:39 ` Sverre Rabbelier
2009-10-29 18:43 ` Daniel Barkalow
2009-10-29 18:47 ` Sverre Rabbelier
[not found] ` <1256798426-21816-2-git-send-email-srabbelier@gmail.com>
2009-10-29 12:05 ` [PATCH 1/7] Refactor git_remote_cvs to a more generic git_remote_helpers Johan Herland
2009-10-29 15:48 ` Sverre Rabbelier
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=20091029142232.GS10505@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=johan@herland.net \
--cc=srabbelier@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;
as well as URLs for NNTP newsgroup(s).