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

Re: git-unpack-objects < pack file in repository doesn't work!

From
Shawn Pearce <spearce@spearce.org>
Date
Mar 7, 2006, 02:29 UTC
Message-ID
<20060307022926.GB29180@spearce.org>
In-Reply-To
<200603070213.02805.blaisorblade@yahoo.it>
Blaisorblade <blaisorblade@yahoo.it> wrote:
Show 13 quoted lines
> It's not a bug, it's an undocumented feature. It should be documented as 
> "git-unpack-objects < $pack; rm $pack" is something one would deem correct at 
> first glance (luckily I just moved the pack away and did git-fsck-cache).
> 
> To write an object, git-unpack-objects ends in
> 
> unpack-objects.c:write_object -> sha1_file.c:write_sha1_file:
> 
>         /* Normally if we have it in the pack then we do not bother writing
>          * it out into .git/objects/??/?{38} file.
>          */
> 
> This indeed works, so the files aren't unpacked.

Funny, I just did the exact same thing today, scratched my head and said ``what did I just do!?!?!'' as I had deleted the pack before discovering that nothing was actually unpacked. *sigh* At least it was a clone of the real repository and thus didn't matter to me.

I totally didn't expect that behavior. But I should have. It makes perfect sense.

-- 
Shawn.
Previous: BlaisorbladeNext: Junio C Hamano
Message 2 of 5 in “git-unpack-objects < pack file in repository doesn't work!”
  1. BlaisorbladeMar 7, 2006
  2. Shawn PearceMar 7, 2006
  3. Junio C HamanoMar 7, 2006
  4. Shawn PearceMar 7, 2006
  5. Junio C HamanoMar 9, 2006

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.