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

Re: clarify git clone --local --shared --reference

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Jun 13, 2007, 23:07 UTC
Message-ID
<467078B1.8080104@nrlssc.navy.mil>
In-Reply-To
<20070608053750.GB18521@spearce.org>
Shawn O. Pearce wrote:
> Brandon Casey <casey@nrlssc.navy.mil> wrote:
Show 12 quoted lines
>> The docs (git-repack.txt) seem to suggest that git-repack (without -d) 
>> does not delete any objects. And if -d is used, then at most objects 
>> already referenced in other packs will be deleted. This makes me think 
>> that repack is safe on the source repository.
> 
> You are correct that leaving off the '-d' won't delete objects.
> But a pack is created by listing the objects we need, and if we don't
> need the object in source, we don't include it into the new pack.
> 
> -a -d implies delete all packs that existed when we started the
> repack.  So if an object was in the old packfile, and we didn't
> copy it to the new packfile, it gets deleted.  ;-)

Ok. There is the connection I did not make. repack -d is NOT harmless, since a pack that contains only objects referenced in other packs and dangling unreferenced objects, will be deleted. Which will be all of the preexisting packs in the case of git-gc since as you mentioned it repacks using -a -d -l.

Thanks for taking the time.
-brandon
Previous: Brandon Casey
Message 10 of 10 in “clarify git clone --local --shared --reference”
  1. Brandon CaseyJun 4, 2007
  2. Shawn O. PearceJun 5, 2007
  3. Brandon CaseyJun 5, 2007
  4. Shawn O. PearceJun 6, 2007
  5. Brandon CaseyJun 6, 2007
  6. Brandon CaseyJun 6, 2007
  7. Shawn O. PearceJun 8, 2007
  8. Loeliger Jon-LOELIGERJun 8, 2007
  9. Brandon CaseyJun 8, 2007
  10. Brandon CaseyJun 13, 2007

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.