{"modulePath":"github.com/mapmeld/codemingler","version":"v0.6.9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\n## Variables\n\n```go\nvar CommitsRangeSize = 50\n```\n\n```go\nvar (\n\tErrNotExist = errors.New(\"error not exist\")\n)\n```\n\n```go\nvar (\n\tErrNotValidHook = errors.New(\"not a valid Git hook\")\n)\n```\n\n```go\nvar (\n\tIdNotExist = errors.New(\"sha1 id not exist\")\n)\n```\n\n## Functions\n\n```go\nfunc IsBranchExist(repoPath, branchName string) bool\n```\n\n```go\nfunc IsTagExist(repoPath, tagName string) bool\n```\n\n```go\nfunc IsValidHookName(name string) bool\n```\nIsValidHookName returns true if given name is a valid Git hook.\n\n```go\nfunc NewId(b []byte) (sha1, error)\n```\nCreate a new sha1 from a 20 byte slice.\n\n```go\nfunc NewIdFromString(s string) (sha1, error)\n```\nCreate a new sha1 from a Sha1 string of length 40.\n\n```go\nfunc RefEndName(refStr string) string\n```\n\n## Types\n\n```go\ntype ArchiveType int\n```\n\n```go\nconst (\n\tZIP ArchiveType = iota + 1\n\tTARGZ\n)\n```\n\n```go\ntype Blob struct {\n\t*TreeEntry\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (b *Blob) Data() (io.Reader, error)\n```\n\n```go\ntype Commit struct {\n\tTree\n\tId            sha1 // The id of this commit object\n\tAuthor        *Signature\n\tCommitter     *Signature\n\tCommitMessage string\n\t// contains filtered or unexported fields\n}\n```\nCommit represents a git commit.\n\n```go\nfunc (c *Commit) CommitsBefore() (*list.List, error)\n```\n\n```go\nfunc (c *Commit) CommitsBeforeUntil(commitId string) (*list.List, error)\n```\n\n```go\nfunc (c *Commit) CommitsByRange(page int) (*list.List, error)\n```\n\n```go\nfunc (c *Commit) CommitsCount() (int, error)\n```\n\n```go\nfunc (c *Commit) CreateArchive(path string, archiveType ArchiveType) error\n```\n\n```go\nfunc (c *Commit) GetCommitOfRelPath(relPath string) (*Commit, error)\n```\n\n```go\nfunc (c *Commit) GetSubModule(entryname string) (*SubModule, error)\n```\n\n```go\nfunc (c *Commit) GetSubModules() (map[string]*SubModule, error)\n```\n\n```go\nfunc (c *Commit) IsImageFile(name string) bool\n```\n\n```go\nfunc (c *Commit) Message() string\n```\nReturn the commit message. Same as retrieving CommitMessage directly.\n\n```go\nfunc (c *Commit) Parent(n int) (*Commit, error)\n```\nReturn parent number n (0-based index)\n\n```go\nfunc (c *Commit) ParentCount() int\n```\nReturn the number of parents of the commit. 0 if this is the root commit, otherwise 1,2,...\n\n```go\nfunc (c *Commit) ParentId(n int) (id sha1, err error)\n```\nReturn oid of the parent number n (0-based index). Return nil if no such parent exists.\n\n```go\nfunc (c *Commit) SearchCommits(keyword string) (*list.List, error)\n```\n\n```go\nfunc (c *Commit) Summary() string\n```\n\n```go\ntype Entries []*TreeEntry\n```\n\n```go\nfunc (bs Entries) Len() int\n```\n\n```go\nfunc (bs Entries) Less(i, j int) bool\n```\n\n```go\nfunc (bs Entries) Sort()\n```\n\n```go\nfunc (bs Entries) Swap(i, j int)\n```\n\n```go\ntype EntryMode int\n```\n\n```go\nconst (\n\tModeBlob    EntryMode = 0100644\n\tModeExec    EntryMode = 0100755\n\tModeSymlink EntryMode = 0120000\n\tModeCommit  EntryMode = 0160000\n\tModeTree    EntryMode = 0040000\n)\n```\nThere are only a few file modes in Git. They look like unix file modes, but they can only be one of these.\n\n```go\ntype Hook struct {\n\tIsActive bool   // Indicates whether repository has this hook.\n\tContent  string // Content of hook if it's active.\n\tSample   string // Sample content from Git.\n\t// contains filtered or unexported fields\n}\n```\nHook represents a Git hook.\n\n```go\nfunc GetHook(repoPath, name string) (*Hook, error)\n```\nGetHook returns a Git hook by given name and repository.\n\n```go\nfunc ListHooks(repoPath string) (_ []*Hook, err error)\n```\nListHooks returns a list of Git hooks of given repository.\n\n```go\nfunc (h *Hook) Name() string\n```\n\n```go\nfunc (h *Hook) Update() error\n```\nUpdate updates hook settings.\n\n```go\ntype ObjectType string\n```\n\n```go\nconst (\n\tCOMMIT ObjectType = \"commit\"\n\tTREE   ObjectType = \"tree\"\n\tBLOB   ObjectType = \"blob\"\n\tTAG    ObjectType = \"tag\"\n)\n```\n\n```go\ntype PullRequestInfo struct {\n\tMergeBase string\n\tCommits   *list.List\n\t// Diff      *Diff\n\tNumFiles int\n}\n```\n\n```go\ntype Repository struct {\n\tPath string\n\t// contains filtered or unexported fields\n}\n```\nRepository represents a Git repository.\n\n```go\nfunc OpenRepository(repoPath string) (*Repository, error)\n```\nOpenRepository opens the repository at the given path.\n\n```go\nfunc (repo *Repository) CommitsBetween(last *Commit, before *Commit) (*list.List, error)\n```\nused only for single tree, (]\n\n```go\nfunc (repo *Repository) CommitsByFileAndRange(branch, file string, page int) (*list.List, error)\n```\n\n```go\nfunc (repo *Repository) CommitsCount(commitId string) (int, error)\n```\n\n```go\nfunc (repo *Repository) CommitsCountBetween(startCommitID, endCommitID string) (int, error)\n```\n\n```go\nfunc (repo *Repository) CreateTag(tagName, idStr string) error\n```\n\n```go\nfunc (repo *Repository) FileCommitsCount(branch, file string) (int, error)\n```\n\n```go\nfunc (repo *Repository) FilesCountBetween(startCommitID, endCommitID string) (int, error)\n```\n\n```go\nfunc (repo *Repository) GetBranches() ([]string, error)\n```\n\n```go\nfunc (repo *Repository) GetCommit(commitId string) (*Commit, error)\n```\nFind the commit object in the repository.\n\n```go\nfunc (repo *Repository) GetCommitIdOfBranch(branchName string) (string, error)\n```\n\n```go\nfunc (repo *Repository) GetCommitIdOfTag(tagName string) (string, error)\n```\n\n```go\nfunc (repo *Repository) GetCommitOfBranch(branchName string) (*Commit, error)\n```\nget branch's last commit or a special commit by id string\n\n```go\nfunc (repo *Repository) GetCommitOfTag(tagName string) (*Commit, error)\n```\n\n```go\nfunc (repo *Repository) GetHook(name string) (*Hook, error)\n```\n\n```go\nfunc (repo *Repository) GetPatch(basePath, baseBranch, headBranch string) ([]byte, error)\n```\nGetPatch generates and returns patch data between given branches.\n\n```go\nfunc (repo *Repository) GetPullRequestInfo(basePath, baseBranch, headBranch string) (*PullRequestInfo, error)\n```\nGetPullRequestInfo generates and returns pull request information between base and head branches of repositories.\n\n```go\nfunc (repo *Repository) GetTag(tagName string) (*Tag, error)\n```\nGetTag returns a Git tag by given name.\n\n```go\nfunc (repo *Repository) GetTags() ([]string, error)\n```\nGetTags returns all tags of given repository.\n\n```go\nfunc (repo *Repository) GetTree(idStr string) (*Tree, error)\n```\nFind the tree object in the repository.\n\n```go\nfunc (repo *Repository) Hooks() ([]*Hook, error)\n```\n\n```go\nfunc (repo *Repository) IsBranchExist(branchName string) bool\n```\n\n```go\nfunc (repo *Repository) IsTagExist(tagName string) bool\n```\n\n```go\nfunc (repo *Repository) Merge(headRepoPath string, baseBranch, headBranch string) error\n```\nMerge merges pull request from head repository and branch.\n\n```go\ntype Signature struct {\n\tEmail string\n\tName  string\n\tWhen  time.Time\n}\n```\nAuthor and Committer information\n\n```go\ntype SubModule struct {\n\tName string\n\tUrl  string\n}\n```\n\n```go\ntype SubModuleFile struct {\n\t*Commit\n\t// contains filtered or unexported fields\n}\n```\nSubModuleFile represents a file with submodule type.\n\n```go\nfunc NewSubModuleFile(c *Commit, refUrl, refId string) *SubModuleFile\n```\n\n```go\nfunc (sf *SubModuleFile) RefId() string\n```\nRefId returns reference ID.\n\n```go\nfunc (sf *SubModuleFile) RefUrl() string\n```\nRefUrl guesses and returns reference URL.\n\n```go\ntype Tag struct {\n\tName string\n\tId   sha1\n\n\tObject     sha1 // The id of this commit object\n\tType       string\n\tTagger     *Signature\n\tTagMessage string\n\t// contains filtered or unexported fields\n}\n```\nTag represents a Git tag.\n\n```go\nfunc (tag *Tag) Commit() (*Commit, error)\n```\n\n```go\ntype Tree struct {\n\tId sha1\n\t// contains filtered or unexported fields\n}\n```\nA tree is a flat directory listing.\n\n```go\nfunc NewTree(repo *Repository, id sha1) *Tree\n```\n\n```go\nfunc (t *Tree) GetBlobByPath(rpath string) (*Blob, error)\n```\n\n```go\nfunc (t *Tree) GetTreeEntryByPath(relpath string) (*TreeEntry, error)\n```\n\n```go\nfunc (t *Tree) ListEntries(relpath string) (Entries, error)\n```\n\n```go\nfunc (t *Tree) SubTree(rpath string) (*Tree, error)\n```\n\n```go\ntype TreeEntry struct {\n\tId   sha1\n\tType ObjectType\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (te *TreeEntry) Blob() *Blob\n```\n\n```go\nfunc (te *TreeEntry) EntryMode() EntryMode\n```\n\n```go\nfunc (te *TreeEntry) IsDir() bool\n```\n\n```go\nfunc (te *TreeEntry) IsSubModule() bool\n```\n\n```go\nfunc (te *TreeEntry) Name() string\n```\n\n```go\nfunc (te *TreeEntry) Size() int64\n```\n\n```go\ntype Version struct {\n\tMajor, Minor, Patch int\n}\n```\nVersion represents version of Git.\n\n```go\nfunc GetVersion() (*Version, error)\n```\nGetVersion returns current Git version installed.\n\n```go\nfunc MustParseVersion(verStr string) *Version\n```\n\n```go\nfunc ParseVersion(verStr string) (*Version, error)\n```\n\n```go\nfunc (v *Version) AtLeast(that *Version) bool\n```\n\n```go\nfunc (v *Version) Compare(that *Version) int\n```\nCompare compares two versions, it returns 1 if original is greater, -1 if original is smaller, 0 if equal.\n\n```go\nfunc (v *Version) LessThan(that *Version) bool\n```\n\n","path":"github.com/mapmeld/codemingler/modules/git","name":"git","synopsis":"","isRedistributable":true}
