git

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package git provides git repository detection and context

Index

Constants

This section is empty.

Variables

View Source
var TaskCodePattern = regexp.MustCompile(`([A-Z]{2,5})-(\d+)`)

TaskCodePattern matches task codes like ABC-123 Each GitScrum project has its own prefix (e.g., GS, WEB, API)

Functions

func FindRepoRoot

func FindRepoRoot(path string) (string, error)

FindRepoRoot finds the root of the git repository

func IsGitRepo

func IsGitRepo(path string) bool

IsGitRepo checks if the path is inside a git repository

Types

type Context

type Context struct {
	// RepoPath is the root path of the repository
	RepoPath string

	// RootPath is alias for RepoPath (for compatibility)
	RootPath string

	// Branch is the current branch name
	Branch string

	// RemoteURL is the origin remote URL
	RemoteURL string

	// TaskCode extracted from branch (e.g., GS-123)
	TaskCode string

	// Provider is github/gitlab/bitbucket
	Provider string

	// RepoFullName is owner/repo format
	RepoFullName string
}

Context holds git repository information

func NewContext

func NewContext(path string) (*Context, error)

NewContext is an alias for ResolveContext (for compatibility)

func ResolveContext

func ResolveContext(path string) (*Context, error)

ResolveContext detects git context from current directory

Jump to

Keyboard shortcuts

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