From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 5/6 (v2)] upload-pack: send the HEAD information
Date: Mon, 1 Dec 2008 12:44:15 -0500 [thread overview]
Message-ID: <20081201174414.GA22185@coredump.intra.peff.net> (raw)
In-Reply-To: <1228140775-29212-6-git-send-email-gitster@pobox.com>
On Mon, Dec 01, 2008 at 06:12:54AM -0800, Junio C Hamano wrote:
> + packet_write(1, "%s %s%c%s%c%s\n", sha1_to_hex(sha1), refname,
> + 0, capabilities, 0, target);
Yuck. My two complaints are:
(1) this implicitly handles only the HEAD symref. I don't think any
others are in common use, but the rest of git handles arbitrary
symrefs just fine. It would be a shame to needlessly limit the
protocol. Can we at least make it <ref>:<ref> to allow later
expansion to other symrefs?
(1a) As a follow-on to that, because the client is not requesting
anything, how would we ask for other symrefs if we want to do so
later? I think it would be nice to eventually allow copying of
arbitrary symrefs within the refs/* hierarchy (e.g.,
project-specific branch aliases). Sending all symrefs right off
the bat is potentially large and wasteful.
(2) You've used up the first such expansion slot forever. Now it's "if
I want to tell you the symref, there is an extra slot, and
otherwise none". But if we ever want to use the _next_ slot, then
you will always have to send this slot (blank, I guess?). It gets
even more complicated if you ever want to an arbitrary number of
symref mappings. Maybe a short header to say "this slot contains a
symref target"?
So (1) and (2) together would make it something like:
<capabilities>\0
symref HEAD:refs/heads/master\0
symref refs/heads/alias:refs/heads/branch\n
which would make adding any new features in the expansion slots easier.
But that still doesn't address (1a). I really like the other proposal a
lot better.
-Peff
next prev parent reply other threads:[~2008-12-01 17:45 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
2008-12-01 17:44 ` Jeff King [this message]
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=20081201174414.GA22185@coredump.intra.peff.net \
--to=peff@peff.net \
--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).