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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 21, 2015, 05:58 UTC
Message-ID
<xmqq8ufryff4.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAGZ79kZAtnhKYQgoA=d-UfQ8LfH4qTxaAFpJRJPSYApD7dwtzg@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 17 quoted lines
> On Wed, Feb 18, 2015 at 6:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> On Wed, Feb 18, 2015 at 4:43 PM, Shawn Pearce <spearce@spearce.org> wrote:
>>>
>>> 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.
>>
>> That is exactly why the rephrasing was brought up, wasn't it?
>>
>> As the Subject: line says, this thread is for people who want to
>> help those users with un-odd message, so discuss away
>> and come up with a final applicable patch ;-).
>
> "warning: remote HEAD does not exist, not checking out any branch."
>
> would then be the correct answer.

Technically speaking, that is incorrect because HEAD already points at 'master'. We DO check out a 'master' branch. What is unusual is that the branch has not been born yet, and that is exactly the same state after 'git init' created an empty directory. I.e.

	$ git init new
        $ cd new
        $ git remote add origin $URL
	$ git symbolic-ref HEAD
        refs/heads/master

would be exactly the same place where you are when you see that message.

What we are not doing is not "not checking out". What we are not doing is to fast-forwarding the void to any of the branches the remote has, because we do not know which branch the remote wants us to start our history from by default.

So, "warning: not starting history of 'master' from any of the remote's branches, as their HEAD does not point to a valid branch" or something like that?

Previous: Stefan BellerNext: Stefan Beller
Message 8 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.