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

Why does send-pack call pack-objects for all remote refs?

From
DKDaniel Koverman <dkoverman@predictivetechnologies.com>
Date
Dec 7, 2015, 21:02 UTC
Message-ID
<4766c8518c2a46afb88fc0a2dd9a1688@EXCHANGE1U.uunet.arlington.PredictiveTechnologies.com>
I have a repository which has ~2000 branches on the remote, and it takes ~8 seconds to push a change to one ref. The majority of this time is spent in pack-object. I wrote a hack so that only the ref being updated would be packed (the normal behavior is to pack for every ref on the remote).  The push time dropped to <1 second with (seemingly) no consequences. This raised a couple of questions:
1) Are there consequences for not packing refs that are not being updated? Can all operations in send-pack which operate on other refs be skipped?
2) Why isn't git more selective about what it packs? Is it simply a performance optimization not worth the implementation complexity?
3) Is something about my repository strange? ex: 2000 is too many branches, packing for each ref takes me an unusually long time, etc.
Thanks in advance to anyone who takes the time to clarify this for me.
Daniel
Next: Junio C Hamano
Message 1 of 10 in “Why does send-pack call pack-objects for all remote refs?”
  1. Daniel KovermanDec 7, 2015
  2. Junio C HamanoDec 7, 2015
  3. Jeff KingDec 7, 2015
  4. Daniel KovermanDec 8, 2015
  5. Jeff KingDec 10, 2015
  6. Nasser GrainawiDec 12, 2015
  7. Daniel KovermanDec 14, 2015
  8. Jeff KingDec 14, 2015
  9. Jonathan NiederDec 14, 2015
  10. Jeff KingDec 14, 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.