git

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client handles Git operations

func NewClient

func NewClient(workDir string) *Client

NewClient creates a new Git client

func (*Client) GetCommitInfo

func (c *Client) GetCommitInfo(commitHash string) (*CommitInfo, error)

GetCommitInfo returns detailed commit information

func (*Client) GetCommitMessage

func (c *Client) GetCommitMessage(commitHash string) (string, error)

GetCommitMessage returns the commit message for a given hash

func (*Client) GetCurrentBranch

func (c *Client) GetCurrentBranch() (string, error)

GetCurrentBranch returns the current branch name

func (*Client) GetCurrentCommit

func (c *Client) GetCurrentCommit() (string, error)

GetCurrentCommit returns the current commit hash

func (*Client) GetShortCommit

func (c *Client) GetShortCommit() (string, error)

GetShortCommit returns the short commit hash (7 chars)

func (*Client) GetStatus

func (c *Client) GetStatus() (string, error)

GetStatus returns the git status output

func (*Client) GetUserEmail

func (c *Client) GetUserEmail() (string, error)

GetUserEmail returns the git user email

func (*Client) GetUserName

func (c *Client) GetUserName() (string, error)

GetUserName returns the git user name

func (*Client) HasUncommittedChanges

func (c *Client) HasUncommittedChanges() (bool, error)

HasUncommittedChanges checks if there are uncommitted changes

func (*Client) IsRepository

func (c *Client) IsRepository() bool

IsRepository checks if the current directory is a Git repository

type CommitInfo

type CommitInfo struct {
	Hash      string
	ShortHash string
	Message   string
	Author    string
	Branch    string
}

GetCommitInfo returns formatted commit information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL