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

Re: How to clone-pack the HEAD?

From
Junio C Hamano <junkio@cox.net>
Date
Dec 15, 2005, 01:20 UTC
Message-ID
<7vfyovtaub.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051215004440.GM22159@pasky.or.cz>
Petr Baudis <pasky@ucw.cz> writes:
>   (i) git-clone-pack url HEAD doesn't work

"clone-pack url branchname" might work, but the thing is, nobody uses clone-pack with explicit heads arguments so if HEAD does not work I am not surprised at all.

>   (ii) git-clone-pack has hardcoded assumptions about refs/heads/master

I've read that part of the code twice in the past, but my recollection is it tries hard to "guess" where HEAD points at (because the remote side does not tell us, other than which commit object HEAD points at). When more than two branch heads point at the same commit as HEAD records, it gives preference to "master" branch while guessing, but otherwise there is nothing special about the "master" branch.

The problem is, clone-pack is about cloning and not fetching. I am not claiming it is the right design decision --- after all, it was the oldest of the git native protocol driver suite --- but just stating where it stands with all the history behind its (and git-fetch-pack's) evolution.

I think extending git-fetch-pack to optionally keep things packed would be somewhat painful but the right approach. Less painful and readily doable would be to run clone-pack as is, and reorganize the result of "copy of the remote" yourself. That would be a straightforward thing to do if you are using it for the initial cloning.

Previous: Petr BaudisNext: Petr Baudis
Message 2 of 10 in “How to clone-pack the HEAD?”
  1. Petr BaudisDec 15, 2005
  2. Junio C HamanoDec 15, 2005
  3. Petr BaudisDec 15, 2005
  4. Junio C HamanoDec 15, 2005
  5. Junio C HamanoDec 15, 2005
  6. Junio C HamanoDec 15, 2005
  7. Junio C HamanoDec 15, 2005
  8. Petr BaudisDec 18, 2005
  9. Petr BaudisDec 18, 2005
  10. Petr BaudisDec 15, 2005

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.