git

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRemoteURL

func ParseRemoteURL(rawURL string) (provider, project string, err error)

ParseRemoteURL extracts the provider and project from a git remote URL. Supports SSH and HTTPS formats for GitHub and GitLab (including subgroups).

func SlugifyBranch

func SlugifyBranch(branch string) string

SlugifyBranch converts a branch name to a URL-safe slug. e.g., "feat/my-feature" → "feat-my-feature"

Types

type GitContext

type GitContext struct {
	Provider  string // "gitlab" or "github"
	Project   string // "org/repo" or "group/subgroup/repo"
	Branch    string // current branch name
	RemoteURL string // raw remote URL
}

GitContext holds the detected git repository context.

func Detect

func Detect() (*GitContext, error)

Detect auto-detects git context from the current working directory. It runs git commands to determine the current branch and remote URL.

Jump to

Keyboard shortcuts

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