Documentation
¶
Index ¶
- Constants
- Variables
- func FindCommitByPatchID(patchID, startCommit string, limit int) (string, error)
- func GetAncestors(commit string, limit int) ([]string, error)
- func GetAncestorsUpTo(start, end string) ([]string, error)
- func GetCurrentBranch() (string, error)
- func GetGitDir() (string, error)
- func GetHEAD() (string, error)
- func GetPatchID(commit string) (string, error)
- func GetRepoRoot() (string, error)
- func GetShortSHA(commit string) (string, error)
- func IsAncestor(ancestor, descendant string) (bool, error)
- func IsDetachedHead() bool
- func IsInsideWorkTree() bool
- func Run(args ...string) (string, error)
- func RunWithStdin(stdin string, args ...string) (string, error)
- type CommitInfo
Constants ¶
const NotesRef = "remarks"
NotesRef is the git notes reference used for remarks
Variables ¶
var ErrDetachedHead = errors.New("not on a branch (detached HEAD)")
ErrDetachedHead is returned when the repository is in detached HEAD state
Functions ¶
func FindCommitByPatchID ¶
FindCommitByPatchID searches for a commit with matching patch-id in the given range
func GetAncestors ¶
GetAncestors returns all ancestor commits from the given commit up to the specified limit (0 = no limit)
func GetAncestorsUpTo ¶
GetAncestorsUpTo returns all ancestor commits from start to end (exclusive)
func GetCurrentBranch ¶
GetCurrentBranch returns the current branch name
func GetPatchID ¶
GetPatchID computes the patch-id for a commit
func GetRepoRoot ¶
GetRepoRoot returns the root directory of the git repository
func GetShortSHA ¶
GetShortSHA returns the short SHA for a commit
func IsAncestor ¶
IsAncestor returns true if ancestor is an ancestor of descendant
func IsDetachedHead ¶
func IsDetachedHead() bool
IsDetachedHead returns true if the repository is in detached HEAD state
func IsInsideWorkTree ¶
func IsInsideWorkTree() bool
IsInsideWorkTree checks if the current directory is inside a git repository
Types ¶
type CommitInfo ¶
CommitInfo contains basic information about a commit
func GetCommitLog ¶
func GetCommitLog(commit string, limit int) ([]CommitInfo, error)
GetCommitLog returns a list of commits with their short SHAs and subjects