gogit v0.15.1 Release Notes
Release Date: 2026-10-28
Overview
A patch release with two fixes and a memory improvement for history walks. There are no API changes: code built against v0.15.0 builds unchanged.
Performance
gitgrep.StreamPatches streams instead of buffering
StreamPatches used to read the whole git log -p output into memory,
parse it, and only then call back. A full-history walk (--all) therefore
held every diff in the repository at once, and the callback could not start
until git had finished.
It now reads git's output as it is written and passes each file diff to the callback as soon as that diff is complete. Memory use is bounded by the largest single file diff rather than the whole history, and the callback's work overlaps git's. If the callback returns an error, git is stopped instead of being read to the end. Lines are read whole however long they are, since minified or generated files can put megabytes on one line.
HistoryPickaxe parses with the same reader, so both share one patch
parser.
Fixed
Repo.LsTree leaves out submodule entries
A submodule entry (mode 160000) names a commit in another repository, so
ShowContent on its path failed with a bad object error, and a caller that
read every listed file stopped there. LsTree now returns only entries that
have content.
gitgrep reads a patch's path from its diff header
The path of a file diff was taken from any line starting with +++ b/ or
--- a/, including lines inside the diff. An added line whose content
begins ++ b/ appears as +++ b/ and could be taken for the file's path.
The path now comes from the diff header only, before the first hunk.
Installation
go get github.com/grokify/gogit@v0.15.1
go install github.com/grokify/gogit/cmd/gitscan@v0.15.1
See CHANGELOG.md for the categorized commit list.