0.8.0
Version 0.8 adds two new packages: object and packfile. These are pure Go implementations of the Git data structures and wire protocol, respectively. While most users will not interact with these packages directly, this provides better correctness guarantees, and makes it easier to directly read or write objects to a Git repository. Users that inspect commits with the git package now receive a higher fidelity data structure than before.
Added
- A new
objectpackage enables serializing and deserializing Git objects. - A new
packfilepackage enables reading and writing the Git packfile format. (#4)
Changed
*Git.CommitInfoand*Log.CommitInfonow return an*object.Commitinstead of a*git.CommitInfo.CommitOptions.Author,CommitOptions.Committer,AmendOptions.AuthorandAmendOptions.Committerare now typeobject.Userinstead ofgit.User.*Git.Lognow callsgit rev-list | git cat-fileinstead ofgit logand parses the commits directly. One slight semantic change: ifHEADdoes not exist (an empty repository), then*Log.Closereturns an error.*TreeEntry.Modenow sets bothos.ModeDirandos.ModeSymlinkfor submodules. This is more consistent with how Git treats these entries internally.*TreeEntry.ObjectTypenow returns anobject.Typeinstead of astring. It is otherwise functionally identical.
Removed
git.CommitInfohas been removed in favor ofobject.Commit. The latter has mostly the same fields as the former, but does not contain aHashfield because the hash can be computed in Go.git.Userhas been removed in favor ofobject.User. The latter is a string rather than a struct so as to pass through user information from Git objects verbatim.