From: Junio C Hamano <junkio@cox.net>
To: Andy Parkins <andyparkins@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Adding glob support to remotes
Date: Wed, 22 Nov 2006 04:56:34 -0800 [thread overview]
Message-ID: <7v7ixnskql.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <200611220904.21850.andyparkins@gmail.com> (Andy Parkins's message of "Wed, 22 Nov 2006 09:04:20 +0000")
Andy Parkins <andyparkins@gmail.com> writes:
> I started to add code to git-parse-remote.sh:canon_refs_list_for_fetch() to
> preprocess the reflist to catch lines with a "*" in them then use the remote
> pattern to filter the output of from "git-ls-remote -h", blah, blah, you get
> the idea...
>
> However, git-ls-remote needs the name of the remote repository (of course),
> but that isn't directly available in git-parse-remote.sh.
Is it really the case? I do not remember the details offhand,
but I do not think canon_refs_list_for_fetch is the function you
should be messing with to implement the remote."origin".fetch
stuff. It should be get_remote_default_refs_for_fetch(). The
function returns the list based on which remote, so it surely
knows which remote the caller is talking about.
However, I would recommend against actually running ls-remote to
help "git-fetch" inside git-parse-remote.sh. I think you should
run ls-remote upfront early in git-fetch because there are at
least two other parts in git-fetch that wants the same ls-remote
output:
(1) dumb protocols currently cannot deal with a remote that has
run "packed-ref --prune" because git-fetch.sh first uses
curl executable to download the loose ref, read it and then
use the object name read from that to drive git-http-fetch.
We can and should get rid of the /max_depth=5/,/done/ loop
there and replace it with a grep of ls-remote output to
make them work against such a remote. When tracking many
branches from the remote, this would reduce the number of
http requests (one per branch vs a ls-remote which is just
a single download of info/refs).
(2) when doing a fetch with tracking branches (which is what
your change is about), we would need to run ls-remote to
find out the remote tags for tag following purposes anyway.
Running "ls-remote -h" once for your purpose and then
"ls-remote -t" for tag following later is obviously very
wasteful.
next prev parent reply other threads:[~2006-11-22 12:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-22 9:04 Adding glob support to remotes Andy Parkins
2006-11-22 12:56 ` Junio C Hamano [this message]
2006-11-22 14:41 ` Andy Parkins
2006-11-22 20:50 ` Junio C Hamano
2006-11-23 8:44 ` Andy Parkins
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=7v7ixnskql.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=andyparkins@gmail.com \
--cc=git@vger.kernel.org \
/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).