AnthonyChiavelli / VisualGit

Graphical, educational python app for working with git repositories
GNU General Public License v3.0
7 stars 2 forks source link

Handling packfiles in local repository #1

Closed kahmali closed 10 years ago

kahmali commented 10 years ago

See the Git Documentation for more info on packfiles.

Essentially, the git objects that are manually decompressed from disk in the get_git_object_contents() function, in what is currently the LocalRepoApi (and likely soon to be a method of the LocalRepository class), are sometimes decompressed further into what is known as pack files, and because we seem to be getting down into the bowels of git, there doesn't seem to be very much documentation online about how to decompress them from this .pack format.

One solution would be to simply use our Git API to view any git objects, instead of manually decompressing them from disk.

I tried to find some sample code, but so far I've only found this terribly documented cruft. I'm not sure if it even works.

kahmali commented 10 years ago

Originally, we "solved" this by using the GitTerminal to access the git objects via command line, so that we didn't have to do the dirty work of parsing the pack files ourselves. However, that solution was way too slow, and I was forced to get my hands dirty with some packfiles.

I'm now manually parsing the git objects from their loose or packed form, which has sped the algorithm up about 10x. I will create a new issue around the performance of the algorithm, which is good, but needs to be better.