github

package
v0.19.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndInstallMergeDrivers added in v0.15.0

func CheckAndInstallMergeDrivers(repoRoot string) error

CheckAndInstallMergeDrivers checks whether the merge drivers are registered in the local git config and installs them if not. It is safe to call on every command invocation — it skips the write if already configured.

func ConfigureMergeDriver

func ConfigureMergeDriver(repoRoot string) error

ConfigureMergeDriver sets the local git merge driver configuration for both the tick (JSON) and tick-activity (JSONL) drivers.

func DetectOwner

func DetectOwner(run CommandRunner) (string, error)

DetectOwner resolves owner via TICK_OWNER or git config user.email.

func DetectProject

func DetectProject(run CommandRunner) (string, error)

DetectProject resolves the current git remote project via origin.

func EnsureGitAttributes

func EnsureGitAttributes(repoRoot string) error

EnsureGitAttributes adds the tick and tick-activity merge driver lines to .gitattributes if missing. It is idempotent — calling it when both lines already exist is a no-op.

func NormalizeID

func NormalizeID(project, input string) (string, error)

NormalizeID accepts short or global IDs and returns the short ID.

func ParseProjectFromRemote

func ParseProjectFromRemote(remote string) (string, error)

ParseProjectFromRemote extracts owner/repo from a git remote URL.

It handles the common GitHub forms (scp-like SSH "git@host:owner/repo" and "scheme://[user@]host[:port]/owner/repo") as well as proxied remotes that prepend path segments, e.g. the sandbox form "http://local_proxy@127.0.0.1:PORT/git/owner/repo". The owner/repo pair is taken from the last two path segments.

Types

type CommandRunner

type CommandRunner func(name string, args ...string) ([]byte, error)

CommandRunner executes a command and returns stdout.

Jump to

Keyboard shortcuts

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