Hacker News new | ask | show | jobs
by delinka 3927 days ago
Perhaps I'm a bit ignorant of git's storage and protocols, but what's the purpose of this initial count? Seems to me it's traversing the tree twice - once to count and once to send the objects across the network. So why not traverse the tree, sending objects that need to be sent and ignoring the ones that don't instead of counting?
1 comments

You need to know which objects are reachable before you can delta compress them (or reuse a packed delta chain). I guess you could restrict compression antecedents to graph ancestors in your pack, but at the cost of not compressing similar siblings (and blobs are leaves).