Skip to content

0.8.0

Choose a tag to compare

@zombiezen zombiezen released this 31 Dec 23:27
· 103 commits to main since this release

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 object package enables serializing and deserializing Git objects.
  • A new packfile package enables reading and writing the Git packfile format. (#4)

Changed

  • *Git.CommitInfo and *Log.CommitInfo now return an *object.Commit instead of a *git.CommitInfo.
  • CommitOptions.Author, CommitOptions.Committer, AmendOptions.Author and AmendOptions.Committer are now type object.User instead of git.User.
  • *Git.Log now calls git rev-list | git cat-file instead of git log and parses the commits directly. One slight semantic change: if HEAD does not exist (an empty repository), then *Log.Close returns an error.
  • *TreeEntry.Mode now sets both os.ModeDir and os.ModeSymlink for submodules. This is more consistent with how Git treats these entries internally.
  • *TreeEntry.ObjectType now returns an object.Type instead of a string. It is otherwise functionally identical.

Removed

  • git.CommitInfo has been removed in favor of object.Commit. The latter has mostly the same fields as the former, but does not contain a Hash field because the hash can be computed in Go.
  • git.User has been removed in favor of object.User. The latter is a string rather than a struct so as to pass through user information from Git objects verbatim.