From: Junio C Hamano <gitster@pobox.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 5/6 (v2)] upload-pack: send the HEAD information
Date: Mon, 01 Dec 2008 11:54:44 -0800 [thread overview]
Message-ID: <7voczvr7qz.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20081201162011.GI23984@spearce.org> (Shawn O. Pearce's message of "Mon, 1 Dec 2008 08:20:11 -0800")
"Shawn O. Pearce" <spearce@spearce.org> writes:
> Maybe we put on the first capability line a flag that lets the
> client know we have symref data in the advertised list, and then
> instead of sticking only HEAD into that first ref we put the names
> of the symrefs after the ref they point to.
>
> So we might see something like:
>
> xxxx......................... refs/heads/boo\0with-symref\0
> xxxx......................... refs/heads/master\0HEAD\0
> xxxx......................... refs/remotes/origin/HEAD\0refs/remotes/origin/master\0
>
> etc. Its probably harder to produce the output for, but it permits
> advertising all of the symrefs on the remote side, which may be good
> for --mirror, among other uses. It also should make it easier to put
> multiple symrefs down pointing at the same real ref, they could just
> be a space delimited list stored after the ref name, and if its the
> first ref in the stream, after the other capability advertisement.
It certainly is possible, and I think the arrangement v2 code makes
already keeps that option to talk about symrefs other than HEAD open. If
you want to send all the symref information, you would show something
like:
xxxx... HEAD\0<caps>\0refs/heads/master\n
xxxx... refs/heads/master\n
xxxx... refs/remotes/origin/HEAD\0<caps>\0refs/remotes/origin/master\n
xxxx... refs/remotes/origin/master\n
But in this round I am not interested in giving any "random symref"
information but "HEAD", so I omitted it from the code.
Notice that you need to repeat the capabilities list on each and every
line that describes a symbolic ref for that to work (and you do not need
"with-symref"), though. See what ll. 80-84 in connect.c does.
if (len != name_len + 41) {
free(server_capabilities);
server_capabilities = xstrdup(name + name_len + 1);
}
Historical accident mandates that the first hidden piece of information on
each and all of these lines _must_ be the capabilities list.
next prev parent reply other threads:[~2008-12-01 19:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-01 14:12 [PATCH 0/6 (v2)] Detecting HEAD more reliably while cloning Junio C Hamano
2008-12-01 14:12 ` [PATCH 1/6 (v2)] get_remote_heads(): refactor code to read "server capabilities" Junio C Hamano
2008-12-01 14:12 ` [PATCH 2/6 (v2)] connect.c::read_extra_info(): prepare to receive more than server capabilities Junio C Hamano
2008-12-01 14:12 ` [PATCH 3/6 (v2)] connect.c::read_extra_info(): find where HEAD points at Junio C Hamano
2008-12-01 14:12 ` [PATCH 4/6 (v2)] clone: find the current branch more explicitly Junio C Hamano
2008-12-01 14:12 ` [PATCH 5/6 (v2)] upload-pack: send the HEAD information Junio C Hamano
2008-12-01 14:12 ` [PATCH 6/6 (v2)] clone: test the new HEAD detection logic Junio C Hamano
2008-12-01 15:40 ` [PATCH 5/6 (v2)] upload-pack: send the HEAD information Jakub Narebski
2008-12-01 16:20 ` Shawn O. Pearce
2008-12-01 19:54 ` Junio C Hamano [this message]
2008-12-01 17:44 ` Jeff King
2008-12-02 1:31 ` Junio C Hamano
2008-12-02 1:59 ` Jeff King
2008-12-02 2:20 ` Junio C Hamano
2008-12-02 2:36 ` Jeff King
2008-12-01 15:52 ` [PATCH 0/6 (v2)] Detecting HEAD more reliably while cloning Johannes Sixt
2008-12-02 1:33 ` 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=7voczvr7qz.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.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).