Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHeadSHA ¶
GetHeadSHA returns the full SHA of the HEAD commit. Returns empty string and nil if not in a git repo.
func GetRepoURL ¶
GetRepoURL returns the remote origin URL for a git repository Returns empty string if not a git repo or no remote configured
func ToGitHubURL ¶
ToGitHubURL converts a git remote URL to a GitHub HTTPS URL. Handles: git@github.com:owner/repo.git, https://github.com/owner/repo.git, ssh://git@github.com/owner/repo.git Returns empty string if not a GitHub URL.
Types ¶
type GitInfo ¶
type GitInfo struct {
RepoURL string `json:"repo_url,omitempty"`
Branch string `json:"branch,omitempty"`
CommitSHA string `json:"commit_sha,omitempty"`
CommitMessage string `json:"commit_message,omitempty"`
Author string `json:"author,omitempty"`
IsDirty bool `json:"is_dirty"`
}
GitInfo contains git repository information
func DetectGitInfo ¶
DetectGitInfo detects git information from the given directory Returns nil if not in a git repository (this is not an error)
func ExtractGitInfoFromTranscript ¶
ExtractGitInfoFromTranscript parses a Claude Code transcript file to extract git information This is useful for uploading sessions where the original directory may not exist