The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.12.0 - 2024-11-02
Version 0.12 is mostly a bugfix release, but the changes in behavior to fix compatibility seemed large enough to warrant bumping the minor version.
- The
io/fs
package is used forFileMode
andFileInfo
instead ofos
. This should be a compatible change, since theos
types are aliases. *object.Commit.MarshalBinary
will use*time.Location
names if they are in the proper format. (#34)
- Using
packfile/client
to read from an empty repository on old versions (~2.17) of Git no longer returns an error. *object.Commit.UnmarshalBinary
accepts timezones with less than 4 digits. (#34)object.Tree
now orders directories correctly. (Thanks to @yangchi for discovering this issue.)*Config.ListRemotes
matches behavior when running with Git 2.46+.
0.11.0 - 2023-08-01
Version 0.11 adds an iteration API for refs.
- New methods
Git.IterateRefs
andGit.IterateRemoteRefs
provide a streaming API for listing refs.
Git.ListRefs
andGit.ListRefsVerbatim
are deprecated in favor ofGit.IterateRefs
.Git.ListRemoteRefs
is deprecated in favor ofGit.IterateRemoteRefs
.
Log
no longer retains data after closing.- Fixed a panic in
packfile/client.Remote.StartPush
.
0.10.0 - 2022-02-22
Version 0.10 adds several features for mutating refs in a working copy and correctly handles extra fields in commit objects.
- There are several new
git.RefMutation
constructors:SetRef
,SetRefIfMatches
, andCreateRef
. git.RefMutation
has a newIsNoop
method to make it easier to check for the zero value.git.CommitOptions
andgit.AmendOptions
have a new field:SkipHooks
.- New method
Git.DeleteBranches
. object.Commit
has a new fieldExtra
that stores any additional commit fields.
*client.PullStream.ListRefs
and*client.PushStream.Refs
now return a map of refs instead of a slice.
object.ParseCommit
no longer rejects commits with extra fields. (#23)
0.9.0 - 2021-01-26
Version 0.9 adds a new package for interacting with remote Git repositories and
expands the packfile
package to handle random access.
- A new
packfile/client
package enables downloading commits from and uploading commits to remote Git repositories. (#7) - The
packfile.DeltaReader
type is a flexible way of expanding a deltified object from a packfile. - The
packfile.Undeltifier
type decompresses objects from packfiles. - The
packfile.Index
type stores a packfile object ID lookup table that is interoperable with Git packfile index files. (#12) packfile.ReadHeader
enables random access to a packfile.*object.Commit
and*object.Tag
now implementBinaryMarshaler
andBinaryUnmarshaler
in addition toTextMarshaler
andTextUnmarshaler
. This is for symmetry withobject.Tree
.object.Prefix
allows marshaling and unmarshaling the"blob 42\x00"
prefix used as part of the Git object hash.- The new
*Git.Clone
and*Git.CloneBare
methods clone repositories. git.URLFromPath
converts a filesystem path into a URL.
- The
githash
package is now the home for theRef
type. This permits ref string manipulation without depending on the largergit
package.git.Ref
is now a type alias forgithash.Ref
.
- Removed the
packfile.ApplyDelta
function. Thepackfile.DeltaReader
type performs the same function but permits more control over how it's used.
Ref.IsValid
produces less false positives than before. (#16)
0.8.1 - 2021-01-02
Version 0.8.1 updates the README.
0.8.0 - 2020-12-31
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.
- A new
object
package enables serializing and deserializing Git objects. - A new
packfile
package enables reading and writing the Git packfile format. (#4)
*Git.CommitInfo
and*Log.CommitInfo
now return an*object.Commit
instead of a*git.CommitInfo
.CommitOptions.Author
,CommitOptions.Committer
,AmendOptions.Author
andAmendOptions.Committer
are now typeobject.User
instead ofgit.User
.*Git.Log
now callsgit rev-list | git cat-file
instead ofgit log
and parses the commits directly. One slight semantic change: ifHEAD
does not exist (an empty repository), then*Log.Close
returns an error.*TreeEntry.Mode
now sets bothos.ModeDir
andos.ModeSymlink
for submodules. This is more consistent with how Git treats these entries internally.*TreeEntry.ObjectType
now returns anobject.Type
instead of astring
. It is otherwise functionally identical.
git.CommitInfo
has been removed in favor ofobject.Commit
. The latter has mostly the same fields as the former, but does not contain aHash
field because the hash can be computed in Go.git.User
has 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.
0.7.3 - 2020-12-13
Version 0.7.3 releases minor fixes.
Git.Add
will no-op if passed no pathspecs.
Git.DiffStatus
will no longer return an error on valid renames. (gg-scm/gg#129)
0.7.2 - 2020-10-04
Version 0.7.2 removed the Windows color no-op.
*Config.Color
and*Config.ColorBool
no longer no-op on Windows. (gg-scm/gg#125)
0.7.1 - 2020-10-03
Version 0.7.1 fixed an issue with working copy renames on old versions of Git.
- Git versions before 2.18 have a bug where they will report renames even if
--disable-renames
is passed.*Git.Status
will rewrite these to an add and a delete. (#3)
0.7.0 - 2020-10-02
Version 0.7 made improvements to fetching commit information.
- The
LogOptions.NoWalk
field permits reading commits in bulk without having to process their ancestors. (#2) - The
CommitInfo.Summary
method returns the first line of a commit message.
0.6.0 - 2020-09-27
Version 0.6 introduced an interface for supplying your own Git process creation mechanism. This was introduced with very little change in public-facing API, so I'm fairly confident that the API can remain stable.
- The Git subprocess invocation can now be customized. A new interface,
Runner
, allows the user to provide their own mechanism for running a Git subprocess. This can be used to communicate with a Git process over SSH or in a container, for example. (#1)
GitDir
andCommonDir
now directly use the Git subprocess to determine the directory paths rather than rely on kludges. This doesn't work on Git 2.13.1 or below, but these versions have not been supported for some time.
- The
*Git.Exe
method has been deprecated in favor of the newly introduced*Local.Exe
.
- The
*Git.Command
method has been removed because it was infeasible to support with the newRunner
structure. TheRunner
interface provides an easier API that works across process-starting mechanisms.
0.5.0 - 2020-09-16
Version 0.5.0 added marshal/unmarshal methods to git.Hash
.
- Add marshal/unmarshal methods to
git.Hash
. - Now building and tested on Windows.
- Debian packaging is now on the
debian
branch.
0.4.1 - 2020-09-02
Version 0.4.1 added Debian package release automation.
0.4.0 - 2020-09-02
Version 0.4.0 changed the signature of a few functions and added some example code to the documentation.
- The signature of
New
has been changed to give all parameters reasonable defaults. In particular,Options.Env
now treatsnil
in the same way asexec.Cmd
. - Renamed
Git.Path
method toGit.Exe
to avoid confusion withGit.WorkTree
andGit.GitDir
.
0.3.0 - 2020-08-28
Version 0.3.0 adds a function for parsing Git URLs.
- Add
ParseURL
function
0.2.0 - 2020-08-17
Version 0.2.0 adds functionality for inspecting submodules.
- Add
Git.ListSubmodules
method
- The signature of
Git.ListTree
has changed to support options and parse full tree entries. To get the old behavior, use theRecursive: true
andNameOnly: true
options.
0.1.0 - 2020-08-13
This is the first release of the gg-scm.io/pkg/git
library outside gg.
It is identical to the internal/git
package released in gg 1.0.1.