git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* pack file object size question
@ 2018-12-16 21:52 Farhan Khan
  2018-12-16 22:14 ` Jonathan Nieder
  2018-12-17 19:39 ` Jeff King
  0 siblings, 2 replies; 6+ messages in thread
From: Farhan Khan @ 2018-12-16 21:52 UTC (permalink / raw)
  To: git

Hi all,

I am trying to write an implementation of "git index-pack" and having
a bit of trouble with understanding the ".pack" format. Specifically,
I am having trouble figuring out the boundary between two objects in
the pack file.

It seems that there is a 12 byte header (signature, version, number of
objects), then it immediately jumps into each individual object. The
object consists of the object header, then the zlib deflated object,
followed by a SHA1 of the above. Is this accurate? If so, where is the
size of the entire object size (object header + zlib deflated object +
sha) identified in git source? I tracked it down to what I believe is
builtin/index-pack.c under the function parse_pack_objects, the
for-loop currently in line 1138, but I cannot find where that object
size is calculated for the next iteration of the loop.

I think what I most specifically need is where the size of the
deflated object is identified.

Thanks,
--
Farhan Khan
PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-12-17 19:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-16 21:52 pack file object size question Farhan Khan
2018-12-16 22:14 ` Jonathan Nieder
2018-12-16 23:36   ` Farhan Khan
2018-12-17  0:14     ` Jonathan Nieder
2018-12-17 15:31       ` Duy Nguyen
2018-12-17 19:39 ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).