Documentation
¶
Index ¶
- func CheckAndInstallMergeDrivers(repoRoot string) error
- func ConfigureMergeDriver(repoRoot string) error
- func DetectOwner(run CommandRunner) (string, error)
- func DetectProject(run CommandRunner) (string, error)
- func EnsureGitAttributes(repoRoot string) error
- func NormalizeID(project, input string) (string, error)
- func ParseProjectFromRemote(remote string) (string, error)
- type CommandRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAndInstallMergeDrivers ¶ added in v0.15.0
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 ¶
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 ¶
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 ¶
NormalizeID accepts short or global IDs and returns the short ID.
func ParseProjectFromRemote ¶
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.