Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are git's thin packs?

Tags:

I haven't found much on thin packs, and the man pages' information is rather cryptic about this. I know it has something to do with slow connections, but what would be a "slow connection"?

What are its pros and cons? When should I use it, when should I not use it?

like image 398
Mauricio Scheffer Avatar asked Oct 18 '09 03:10

Mauricio Scheffer


1 Answers

Note from the git 1.8.5 (Q4 2013):

You would think that disabling the thin option would be with push --no-thin?
You would be wrong until 1.8.5:

"git push --no-thin" actually disables the "thin pack transfer" optimization.


See commit f7c815c for all the gory details, thanks to "pclouds" -- Nguyễn Thái Ngọc Duy:

push: respect --no-thin

  • From the beginning of push.c in 755225d, 2006-04-29, "thin" option was enabled by default but could be turned off with --no-thin.

  • Then Shawn changed the default to 0 in favor of saving server resources in a4503a1, 2007-09-09. --no-thin worked great.

  • One day later, in 9b28851, Daniel extracted some code from push.c to create transport.c. He (probably accidentally) flipped the default value from 0 to 1 in transport_get().

From then on --no-thin is effectively no-op because git-push still expects the default value to be false and only calls transport_set_option() when "thin" variable in push.c is true (which is unnecessary).
Correct the code to respect --no-thin by calling transport_set_option() in both cases.

receive-pack learns about --reject-thin-pack-for-testing option, which only is for testing purposes, hence no document update.

like image 154
VonC Avatar answered Nov 15 '22 11:11

VonC