Versions in this module Expand all Collapse all v2 v2.1.0 Aug 22, 2022 Changes in this version + const DateFormat + var DefaultDiffTreeOptions = &DiffTreeOptions + var ErrCanceled = errors.New("operation canceled") + var ErrDirectoryNotFound = errors.New("directory not found") + var ErrEntryNotFound = errors.New("entry not found") + var ErrFileNotFound = errors.New("file not found") + var ErrMaxTreeDepth = errors.New("maximum tree depth exceeded") + var ErrParentNotFound = errors.New("commit parent not found") + var ErrUnsupportedObject = errors.New("unsupported object type") + func NewTreeRootNode(t *Tree) noder.Noder + type Blob struct + Hash plumbing.Hash + Size int64 + func DecodeBlob(o plumbing.EncodedObject) (*Blob, error) + func GetBlob(s storer.EncodedObjectStorer, h plumbing.Hash) (*Blob, error) + func (b *Blob) Decode(o plumbing.EncodedObject) error + func (b *Blob) Encode(o plumbing.EncodedObject) (err error) + func (b *Blob) ID() plumbing.Hash + func (b *Blob) Reader() (io.ReadCloser, error) + func (b *Blob) Type() plumbing.ObjectType + type BlobIter struct + func NewBlobIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *BlobIter + func (iter *BlobIter) ForEach(cb func(*Blob) error) error + func (iter *BlobIter) Next() (*Blob, error) + type Change struct + From ChangeEntry + To ChangeEntry + func (c *Change) Action() (merkletrie.Action, error) + func (c *Change) Files() (from, to *File, err error) + func (c *Change) Patch() (*Patch, error) + func (c *Change) PatchContext(ctx context.Context) (*Patch, error) + func (c *Change) String() string + type ChangeEntry struct + Name string + Tree *Tree + TreeEntry TreeEntry + type Changes []*Change + func DetectRenames(changes Changes, opts *DiffTreeOptions) (Changes, error) + func DiffTree(a, b *Tree) (Changes, error) + func DiffTreeContext(ctx context.Context, a, b *Tree) (Changes, error) + func DiffTreeWithOptions(ctx context.Context, a, b *Tree, opts *DiffTreeOptions) (Changes, error) + func (c Changes) Len() int + func (c Changes) Less(i, j int) bool + func (c Changes) Patch() (*Patch, error) + func (c Changes) PatchContext(ctx context.Context) (*Patch, error) + func (c Changes) String() string + func (c Changes) Swap(i, j int) + type Commit struct + Author Signature + Committer Signature + Hash plumbing.Hash + Message string + PGPSignature string + ParentHashes []plumbing.Hash + TreeHash plumbing.Hash + func DecodeCommit(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (*Commit, error) + func GetCommit(s storer.EncodedObjectStorer, h plumbing.Hash) (*Commit, error) + func Independents(commits []*Commit) ([]*Commit, error) + func (c *Commit) Decode(o plumbing.EncodedObject) (err error) + func (c *Commit) Encode(o plumbing.EncodedObject) error + func (c *Commit) EncodeWithoutSignature(o plumbing.EncodedObject) error + func (c *Commit) File(path string) (*File, error) + func (c *Commit) Files() (*FileIter, error) + func (c *Commit) ID() plumbing.Hash + func (c *Commit) IsAncestor(other *Commit) (bool, error) + func (c *Commit) MergeBase(other *Commit) ([]*Commit, error) + func (c *Commit) NumParents() int + func (c *Commit) Parent(i int) (*Commit, error) + func (c *Commit) Parents() CommitIter + func (c *Commit) Patch(to *Commit) (*Patch, error) + func (c *Commit) PatchContext(ctx context.Context, to *Commit) (*Patch, error) + func (c *Commit) Stats() (FileStats, error) + func (c *Commit) StatsContext(ctx context.Context) (FileStats, error) + func (c *Commit) String() string + func (c *Commit) Tree() (*Tree, error) + func (c *Commit) Type() plumbing.ObjectType + func (c *Commit) Verify(armoredKeyRing string) (*openpgp.Entity, error) + type CommitFilter func(*Commit) bool + type CommitIter interface + Close func() + ForEach func(func(*Commit) error) error + Next func() (*Commit, error) + func NewCommitAllIter(repoStorer storage.Storer, commitIterFunc func(*Commit) CommitIter) (CommitIter, error) + func NewCommitFileIterFromIter(fileName string, commitIter CommitIter, checkParent bool) CommitIter + func NewCommitIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) CommitIter + func NewCommitIterBSF(c *Commit, seenExternal map[plumbing.Hash]bool, ignore []plumbing.Hash) CommitIter + func NewCommitIterCTime(c *Commit, seenExternal map[plumbing.Hash]bool, ignore []plumbing.Hash) CommitIter + func NewCommitLimitIterFromIter(commitIter CommitIter, limitOptions LogLimitOptions) CommitIter + func NewCommitPathIterFromIter(pathFilter func(string) bool, commitIter CommitIter, checkParent bool) CommitIter + func NewCommitPostorderIter(c *Commit, ignore []plumbing.Hash) CommitIter + func NewCommitPreorderIter(c *Commit, seenExternal map[plumbing.Hash]bool, ignore []plumbing.Hash) CommitIter + func NewFilterCommitIter(from *Commit, isValid *CommitFilter, isLimit *CommitFilter) CommitIter + type DiffTreeOptions struct + DetectRenames bool + OnlyExactRenames bool + RenameLimit uint + RenameScore uint + type File struct + Mode filemode.FileMode + Name string + func NewFile(name string, m filemode.FileMode, b *Blob) *File + func (f *File) Contents() (content string, err error) + func (f *File) IsBinary() (bin bool, err error) + func (f *File) Lines() ([]string, error) + type FileIter struct + func NewFileIter(s storer.EncodedObjectStorer, t *Tree) *FileIter + func (iter *FileIter) Close() + func (iter *FileIter) ForEach(cb func(*File) error) error + func (iter *FileIter) Next() (*File, error) + type FileStat struct + Addition int + Deletion int + Name string + func (fs FileStat) String() string + type FileStats []FileStat + func (fileStats FileStats) String() string + type Hash plumbing.Hash + type LogLimitOptions struct + Since *time.Time + Until *time.Time + type Object interface + Decode func(plumbing.EncodedObject) error + Encode func(plumbing.EncodedObject) error + ID func() plumbing.Hash + Type func() plumbing.ObjectType + func DecodeObject(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (Object, error) + func GetObject(s storer.EncodedObjectStorer, h plumbing.Hash) (Object, error) + type ObjectIter struct + func NewObjectIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *ObjectIter + func (iter *ObjectIter) ForEach(cb func(Object) error) error + func (iter *ObjectIter) Next() (Object, error) + type Patch struct + func (p *Patch) Encode(w io.Writer) error + func (p *Patch) FilePatches() []fdiff.FilePatch + func (p *Patch) Message() string + func (p *Patch) Stats() FileStats + func (p *Patch) String() string + type Signature struct + Email string + Name string + When time.Time + func (s *Signature) Decode(b []byte) + func (s *Signature) Encode(w io.Writer) error + func (s *Signature) String() string + type Tag struct + Hash plumbing.Hash + Message string + Name string + PGPSignature string + Tagger Signature + Target plumbing.Hash + TargetType plumbing.ObjectType + func DecodeTag(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (*Tag, error) + func GetTag(s storer.EncodedObjectStorer, h plumbing.Hash) (*Tag, error) + func (t *Tag) Blob() (*Blob, error) + func (t *Tag) Commit() (*Commit, error) + func (t *Tag) Decode(o plumbing.EncodedObject) (err error) + func (t *Tag) Encode(o plumbing.EncodedObject) error + func (t *Tag) EncodeWithoutSignature(o plumbing.EncodedObject) error + func (t *Tag) ID() plumbing.Hash + func (t *Tag) Object() (Object, error) + func (t *Tag) String() string + func (t *Tag) Tree() (*Tree, error) + func (t *Tag) Type() plumbing.ObjectType + func (t *Tag) Verify(armoredKeyRing string) (*openpgp.Entity, error) + type TagIter struct + func NewTagIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *TagIter + func (iter *TagIter) ForEach(cb func(*Tag) error) error + func (iter *TagIter) Next() (*Tag, error) + type Tree struct + Entries []TreeEntry + Hash plumbing.Hash + func DecodeTree(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (*Tree, error) + func GetTree(s storer.EncodedObjectStorer, h plumbing.Hash) (*Tree, error) + func (t *Tree) Decode(o plumbing.EncodedObject) (err error) + func (t *Tree) Diff(to *Tree) (Changes, error) + func (t *Tree) DiffContext(ctx context.Context, to *Tree) (Changes, error) + func (t *Tree) Encode(o plumbing.EncodedObject) (err error) + func (t *Tree) File(path string) (*File, error) + func (t *Tree) Files() *FileIter + func (t *Tree) FindEntry(path string) (*TreeEntry, error) + func (t *Tree) ID() plumbing.Hash + func (t *Tree) Patch(to *Tree) (*Patch, error) + func (t *Tree) PatchContext(ctx context.Context, to *Tree) (*Patch, error) + func (t *Tree) Size(path string) (int64, error) + func (t *Tree) Tree(path string) (*Tree, error) + func (t *Tree) TreeEntryFile(e *TreeEntry) (*File, error) + func (t *Tree) Type() plumbing.ObjectType + type TreeEntry struct + Hash plumbing.Hash + Mode filemode.FileMode + Name string + type TreeIter struct + func NewTreeIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *TreeIter + func (iter *TreeIter) ForEach(cb func(*Tree) error) error + func (iter *TreeIter) Next() (*Tree, error) + type TreeWalker struct + func NewTreeWalker(t *Tree, recursive bool, seen map[plumbing.Hash]bool) *TreeWalker + func (w *TreeWalker) Close() + func (w *TreeWalker) Next() (name string, entry TreeEntry, err error) + func (w *TreeWalker) Tree() *Tree