gitctx

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package gitctx derives Linear context from the current VCS checkout.

Index

Constants

This section is empty.

Variables

View Source
var ErrIssueReferenceMissing = errors.New("linear issue reference missing")

ErrIssueReferenceMissing marks a checkout without a Linear issue reference.

Functions

func CurrentIssueIdentifier

func CurrentIssueIdentifier(ctx context.Context, dir string) (string, error)

CurrentIssueIdentifier derives the active Linear issue from git or jj checkout context, without restricting to a specific team key.

func CurrentIssueIdentifierForTeam added in v0.7.0

func CurrentIssueIdentifierForTeam(ctx context.Context, dir string, teamKey string) (string, error)

CurrentIssueIdentifierForTeam derives the active Linear issue from git or jj checkout context, restricted to the given team key. An empty team key keeps the unfiltered behavior, so callers without a Pinned Target are unaffected.

func ParseIssueIdentifier

func ParseIssueIdentifier(text string) (string, bool)

ParseIssueIdentifier extracts the first Linear issue identifier from text. An explicit uppercase identifier anywhere in the text always wins; failing that, the first case-insensitive match is normalized to uppercase. This tolerates Linear's own generated branch names (the `branchName` field and the "copy branch name" UI action), which are lowercase.

func ParseIssueIdentifierForTeam added in v0.7.0

func ParseIssueIdentifierForTeam(text string, teamKey string) (string, bool)

ParseIssueIdentifierForTeam extracts the first Linear issue identifier from text, restricted to the given team key. An empty team key keeps the unfiltered behavior of ParseIssueIdentifier, so reads without a Pinned Target are unaffected. A non-empty team key rejects any match whose team-key portion does not equal teamKey, bounding the false-positive risk that case-insensitive matching introduces (e.g. "fix-123", "bug-42").

Types

This section is empty.

Jump to

Keyboard shortcuts

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