git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Discuss] soften warning message after cloning "void"

From
Shawn Pearce <spearce@spearce.org>
Date
Feb 19, 2015, 00:46 UTC
Message-ID
<CAJo=hJuoshE7UOVzz2WYLYFjcbiOuHu_+sfkRTbEc7-7C5cDMA@mail.gmail.com>
In-Reply-To
<CAJo=hJt4qVd_dybSn9Wy2UPpvm1+Kg0pE=vyB_fr0eHqQEXdVg@mail.gmail.com>
On Wed, Feb 18, 2015 at 4:43 PM, Shawn Pearce <spearce@spearce.org> wrote:
Show 26 quoted lines
> On Wed, Feb 18, 2015 at 4:25 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Checking out a random branch is absolutely the worst thing you can
>> do. Personally, I would think that the best thing you can do is to
>> educate your users not to clone from a void. Create some history
>> that is worth sharing, and then push into an empty repository.
>
> Users are dumb.
>
> Consider a website like GitHub where you create a repository on a a
> remote server. It is initialized as an empty repo. They now want to
> clone that empty repo to work with it:
>
>   git clone https://example.com/foo
>   cd foo
>   .... hack hack
>   git commit -a -m "Foo is awesome!"
>   git push
>
> This works from git-core servers because the ref advertisement tells
> the client its an empty repo and its OK to checkout HEAD from nothing
> and its all fine.
>
> This fails from a JGit server because the ref advertisement for an
> empty repository differs and disagrees with the format used by
> git-core. The result is a confused client spewing an odd checkout
> message.

The difference in JGit is intentional. Our cross data center consistency system at $DAY_JOB depends on being able to fetch from one empty repository to another empty repository using the want any object capability, and side-band-64k. The JGit client and server code that speaks the wire protocol needs to send and see the capability lines for that to work, but with no refs there are no lines to send.

So we send capabilities^{} like receive-pack does. But git-core hates all over that during clone of an empty repo.

Previous: Shawn PearceNext: Junio C Hamano
Message 5 of 9 in “[Discuss] soften warning message after cloning "void"”
  1. Junio C HamanoFeb 18, 2015
  2. Stefan BellerFeb 19, 2015
  3. Junio C HamanoFeb 19, 2015
  4. Shawn PearceFeb 19, 2015
  5. Shawn PearceFeb 19, 2015
  6. Junio C HamanoFeb 19, 2015
  7. Stefan BellerFeb 19, 2015
  8. Junio C HamanoFeb 21, 2015
  9. Stefan BellerFeb 19, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.