git

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package git provides utilities to extract Git metadata for files and lines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RepoRoot

func RepoRoot() (string, error)

RepoRoot returns the root directory of the current Git repository.

Types

type BlameInfo

type BlameInfo struct {
	CommitHash string // Commit SHA
	Author     string // Author name
	Email      string // Author email
	Timestamp  time.Time
	Summary    string // Commit message summary
	Line       int    // Line number (1-based)
}

BlameInfo holds blame metadata for a specific line in a file.

func BlameLine

func BlameLine(file string, line int) (*BlameInfo, error)

BlameLine returns blame metadata for a specific file and line.

type CommitMeta

type CommitMeta struct {
	Hash      string    // Commit SHA
	Author    string    // Author name
	Email     string    // Author email
	Timestamp time.Time // Commit date
	Message   string    // Commit message
}

CommitMeta represents metadata about a Git commit.

func LatestCommit

func LatestCommit() (*CommitMeta, error)

LatestCommit returns metadata for the latest commit in the repository.

Jump to

Keyboard shortcuts

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