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

Re: [PATCH] transport-helper: do not request symbolic refs to remote helpers

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 22, 2015, 06:46 UTC
Message-ID
<xmqqwq4fuxbb.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1421631307-20669-1-git-send-email-mh@glandium.org>
Mike Hommey <mh@glandium.org> writes:
Show 14 quoted lines
> A typical remote helper will return a `list` of refs containing a symbolic
> ref HEAD, pointing to, e.g. refs/heads/master. In the case of a clone, all
> the refs are being requested through `fetch` or `import`, including the
> symbolic ref.
>
> While this works properly, in some cases of a fetch, like `git fetch url`
> or `git fetch origin HEAD`, or any fetch command involving a symbolic ref
> without also fetching the corresponding ref it points to, the fetch command
> fails with:
>
>   fatal: bad object 0000000000000000000000000000000000000000
>   error: <remote> did not send all necessary objects
>
> (in the case the remote helper returned '?' values to the `list` command).
Hmph.

Since the most "typical remote helper" I immediately think of is remote-curl and "git fetch https://code.googlesource.com/git HEAD" does not seem to fail that way, I am not sure what to make of the above. It is unclear if you meant that the above is inherent due to the way how remote helper protocol works (e.g. there is only one thing we can associate with a ref and we cannot say "HEAD points at this commit" at the same time we say "HEAD points at refs/heads/master"), or just due to broken or lazy implementation of the remote helpers that are invoked by transport-helper.c interface.

> This is because there is only one ref given to fetch(), and it's not
> further resolved to something at the end of fetch_with_import().
There is no get_refs_list() or something similar involved?
Previous: Mike HommeyNext: Mike Hommey
Message 2 of 8 in “transport-helper: do not request symbolic refs to remote helpers”
  1. transport-helper: do not request symbolic refs to remote helpersMike Hommey, Jan 19, 2015
  2. Junio C HamanoJan 22, 2015
  3. Mike HommeyJan 22, 2015
  4. Junio C HamanoJan 22, 2015
  5. Mike HommeyJan 22, 2015
  6. Junio C HamanoJan 22, 2015
  7. Mike HommeyJan 22, 2015
  8. Junio C HamanoJan 22, 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.