Documentation
¶
Overview ¶
Package project derives a path-independent project identity from a working directory (the directory the agent was started in): the normalized Git remote of the repository containing it, unless that repository ignores it, otherwise the directory name. It reads .git directly instead of shelling out to git, because it runs inside agent hooks where latency matters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeRemote ¶
NormalizeRemote maps the many spellings of a remote to host/path:
git@github.com:Org/Repo.git → github.com/org/repo https://user@github.com/Org/Repo → github.com/org/repo ssh://git@host:2222/org/repo.git → host/org/repo
Types ¶
type Hint ¶
type Hint struct {
// Root is the absolute repository root (or the cwd outside Git).
Root string `json:"root"`
// Name is a human-readable project name (repository directory name).
Name string `json:"name"`
// GitIdentity is the normalized origin remote, e.g. "github.com/org/repo".
GitIdentity string `json:"git_identity,omitempty"`
GitBranch string `json:"git_branch,omitempty"`
GitHead string `json:"git_head,omitempty"`
}
Hint describes the project an event was observed in. It is resolved to a server project_id at upload time, so hooks work offline.