From: Johan Herland <johan@herland.net>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC PATCH 3/3] Support fetching from foreign VCSes
Date: Sun, 01 Feb 2009 03:20:28 +0100 [thread overview]
Message-ID: <200902010320.28128.johan@herland.net> (raw)
In-Reply-To: <alpine.LNX.1.00.0901110335520.19665@iabervon.org>
On Sunday 11 January 2009, Daniel Barkalow wrote:
> This supports a useful subset of the usual fetch logic, mostly in the
> config file.
Hi,
I love the idea of this patch series, and have started working on a CVS
backend for this. I have a question though...
> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> ---
> builtin-fetch.c | 135
> +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed,
> 132 insertions(+), 3 deletions(-)
>
> diff --git a/builtin-fetch.c b/builtin-fetch.c
> index 7b46f8f..14e037e 100644
> --- a/builtin-fetch.c
> +++ b/builtin-fetch.c
> @@ -614,6 +614,136 @@ static void set_option(const char *name, const char
> *value) name, transport->url);
> }
>
> +static struct ref *list_foreign(struct remote *remote)
> +{
[...]
> +}
> +
> +static int import_foreign(struct remote *remote, struct ref *refs)
> +{
[...]
> +}
> +
> +static int fetch_foreign(struct remote *remote)
> +{
> + struct ref *remote_refs = list_foreign(remote);
We retrieve a list of all refs available at the given remote...
> + struct ref *ref_map = NULL;
> + struct ref *rm;
> + struct ref **tail = &ref_map;
> + struct branch *branch;
> + int i;
> +
> + int exit_code = import_foreign(remote, remote_refs);
...and then we start fetching _all_ the refs returned by list_foreign().
When I call "git fetch <vcs-remote> <ref>", I expect _only_ <ref> to be
fetched from the remote, but it seems the above code doesn't even concern
itself with the ref(s) specified on the "git fetch" command-line
I'm not even sure why list_foreign() should be called in this case (except,
maybe, to verify the existence of <ref> before attempting to fetch it).
AFAICS list_foreign() is only needed by "git fetch" if <ref> contains a
wildcard (like the default refspec: +refs/heads/*:refs/remotes/<remote>/*).
...or have I misunderstood something fundamental about how this is going to
work?
Have fun! :)
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
next prev parent reply other threads:[~2009-02-01 3:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-11 20:12 [RFC PATCH 3/3] Support fetching from foreign VCSes Daniel Barkalow
2009-01-12 1:33 ` Junio C Hamano
2009-01-12 5:48 ` Daniel Barkalow
2009-01-12 15:42 ` Shawn O. Pearce
2009-01-12 18:19 ` Daniel Barkalow
2009-01-12 19:09 ` Johannes Schindelin
2009-01-12 19:38 ` Daniel Barkalow
2009-02-01 2:20 ` Johan Herland [this message]
2009-02-01 2:35 ` Daniel Barkalow
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=200902010320.28128.johan@herland.net \
--to=johan@herland.net \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).