model

package
v0.0.0-...-03c0f2a Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package model defines the core data structures for gitmap.

Package model — amendment.go defines the amendment audit record.

Package model — bookmark.go defines the bookmark record for saved commands.

Package model — csharpmetadata.go defines C#-specific metadata structs.

Package model defines data structures for gitmap features.

Package model — envregistry.go defines the env variable registry record.

Package model — export.go defines the full database export structure.

Package model — gometadata.go defines Go-specific metadata structs.

Package model defines the core data structures for gitmap.

Package model — history.go defines the command history audit record.

Package model — pendingtask.go defines pending and completed task records.

Package model — profile.go defines the profile configuration structure.

Package model — project.go defines the DetectedProject struct.

Package model — projecttype.go defines the ProjectType reference struct.

Package model defines the core data structures for gitmap.

Package model defines the core data structures for gitmap.

Package model defines the core data structures for gitmap.

Package model — stats.go defines aggregation structs for command history stats.

Package model — task.go defines the file-sync task record.

Package model — tasktype.go defines the task type lookup record.

Package model — transaction.go defines the SQLite-backed transaction journal records used by the revert/undo subsystem. See spec/04-generic-cli/28-transaction-revert.md for the wire contract.

Package model — TransactionActionRecord (v23+).

One row per typed reversible step inside a Transaction. The Forward and Reverse payloads are opaque JSON blobs whose schema is owned by the per-Kind handler (see gitmap/txn/action.go).

Package model — version_history.go defines the repo version history record.

Package model defines the core data structures for gitmap.

Index

Constants

View Source
const (
	SourceRelease = "release"
	SourceImport  = "import"
	SourceRepo    = "repo"
	SourceTag     = "tag"
)

Release source values.

Variables

This section is empty.

Functions

func CleanRelativePath

func CleanRelativePath(rel string) string

CleanRelativePath returns the OS-native, defensively-normalized form of a manifest-supplied RelativePath. Used at every call site that joins a parsed JSON/CSV manifest row's RelativePath onto a target directory so the resulting absolute path has a single canonical shape regardless of how the row was authored.

Why this exists (the failure mode it prevents):

A manifest authored on macOS / Linux typically writes RelativePath
as `"acme/widget"`. When the same manifest is consumed on Windows
and joined onto `C:\code\` via `filepath.Join`, the result is
`C:\code\acme\widget` — but ONLY because Join happens to call
Clean internally. Sloppier inputs slip through:

  "acme//widget"   → Join leaves the doubled slash on Windows
                     when the second segment is treated as a
                     single token (rare, but observed with
                     hand-edited manifests).
  "./acme/widget"  → leading `.` survives into AbsolutePath that
                     then differs byte-for-byte from a re-scan
                     result, breaking dedup keys in projects.json
                     and the SQLite RepoTracking table.
  "acme/widget/"   → trailing separator survives, producing two
                     distinct strings ("…/widget" and "…/widget/")
                     for the same physical folder.

Normalization steps (intentionally minimal — each one earns its keep against a real failure mode):

  1. filepath.FromSlash — converts forward slashes to the OS-native separator. No-op on Unix, the Windows-correctness step that stops mixed-separator paths from leaking into AbsolutePath.
  2. filepath.Clean — collapses `.`, `..`, doubled separators, and trailing separators. Same canonicalization rule used by canonicalizePMPath in gitmap/cmd/clonepmsync.go and by vscodepm.normalizePath, so all three surfaces agree on "what counts as the same relative path".

Empty input is preserved (returned as ""), NOT normalized to ".". Callers treat empty RelativePath as "no manifest row" — see reclone_summary.go and reclone_confirm.go which both early-return on the empty case. Returning "." here would silently turn that signal into a clone-into-cwd, which is exactly the kind of invisible behavior change this helper exists to prevent.

This helper is the SINGLE source of truth for manifest-side RelativePath normalization. Any new call site that joins a manifest-supplied RelativePath onto a target dir MUST route the RelativePath through CleanRelativePath first.

Types

type Alias

type Alias struct {
	ID        int64  `json:"id"`
	Alias     string `json:"alias"`
	RepoID    int64  `json:"repoId"`
	CreatedAt string `json:"createdAt"`
}

Alias links a short name to a repository for quick access.

type AmendAuthor

type AmendAuthor struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

AmendAuthor holds a name/email pair for amendment records.

type AmendmentRecord

type AmendmentRecord struct {
	ID             int64         `json:"id"`
	Timestamp      string        `json:"timestamp"`
	Branch         string        `json:"branch"`
	FromCommit     string        `json:"fromCommit"`
	ToCommit       string        `json:"toCommit"`
	TotalCommits   int           `json:"totalCommits"`
	PreviousAuthor AmendAuthor   `json:"previousAuthor"`
	NewAuthor      AmendAuthor   `json:"newAuthor"`
	Mode           string        `json:"mode"`
	ForcePushed    bool          `json:"forcePushed"`
	Commits        []CommitEntry `json:"commits"`
}

AmendmentRecord represents a single author-rewrite operation.

type AuthorInfo

type AuthorInfo struct {
	Name         string `json:"name"`
	Email        string `json:"email"`
	TotalCommits int    `json:"totalCommits"`
	FirstCommit  string `json:"firstCommit"`
	LastCommit   string `json:"lastCommit"`
	ActiveDays   int    `json:"activeDays"`
}

AuthorInfo aggregates contribution metrics for a single author.

type BookmarkRecord

type BookmarkRecord struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	Command   string `json:"command"`
	Args      string `json:"args,omitempty"`
	Flags     string `json:"flags,omitempty"`
	CreatedAt string `json:"createdAt,omitempty"`
}

BookmarkRecord represents a saved command+flags combination.

type BranchInfo

type BranchInfo struct {
	Name           string `json:"name"`
	IsRemote       bool   `json:"isRemote"`
	LastCommitSHA  string `json:"lastCommitSHA"`
	LastCommitDate string `json:"lastCommitDate"`
	Ahead          int    `json:"ahead"`
	Behind         int    `json:"behind"`
}

BranchInfo describes a single local or remote branch.

type CloneResult

type CloneResult struct {
	Record  ScanRecord
	Success bool
	Error   string
	Notes   string
}

CloneResult tracks the outcome of a single clone operation.

Notes carries non-fatal diagnostics about how the clone was performed — for example, which branch-selection strategy was applied based on the record's BranchSource.

type CloneSummary

type CloneSummary struct {
	Succeeded int
	Failed    int
	Cloned    []CloneResult
	Errors    []CloneResult
	Skipped   []CloneResult
}

CloneSummary aggregates results of a batch clone operation.

Skipped tracks repos that were already cloned and up to date according to the clone cache; they are also counted in Succeeded since the desired state was achieved without performing a clone or pull.

type CommandHistoryRecord

type CommandHistoryRecord struct {
	ID         int64  `json:"id"`
	Command    string `json:"command"`
	Alias      string `json:"alias,omitempty"`
	Args       string `json:"args,omitempty"`
	Flags      string `json:"flags,omitempty"`
	StartedAt  string `json:"startedAt"`
	FinishedAt string `json:"finishedAt,omitempty"`
	DurationMs int64  `json:"durationMs"`
	ExitCode   int    `json:"exitCode"`
	Summary    string `json:"summary,omitempty"`
	RepoCount  int    `json:"repoCount"`
	CreatedAt  string `json:"createdAt,omitempty"`
}

CommandHistoryRecord represents a single CLI command execution.

type CommandStats

type CommandStats struct {
	Command      string  `json:"command"`
	TotalRuns    int     `json:"totalRuns"`
	SuccessCount int     `json:"successCount"`
	FailCount    int     `json:"failCount"`
	FailRate     float64 `json:"failRate"`
	AvgDuration  int64   `json:"avgDurationMs"`
	MinDuration  int64   `json:"minDurationMs"`
	MaxDuration  int64   `json:"maxDurationMs"`
	LastUsed     string  `json:"lastUsed"`
}

CommandStats holds aggregated statistics for a single command.

type CommitEntry

type CommitEntry struct {
	SHA     string `json:"sha"`
	Message string `json:"message"`
}

CommitEntry holds a single commit's SHA and message.

type CommitInfo

type CommitInfo struct {
	SHA          string   `json:"sha"`
	ShortSHA     string   `json:"shortSHA"`
	Author       string   `json:"author"`
	Email        string   `json:"email"`
	Date         string   `json:"date"`
	Message      string   `json:"message"`
	IsMerge      bool     `json:"isMerge"`
	FilesChanged int      `json:"filesChanged"`
	Insertions   int      `json:"insertions"`
	Deletions    int      `json:"deletions"`
	Tags         []string `json:"tags,omitempty"`
}

CommitInfo holds metadata for a single commit.

type CompletedTaskRecord

type CompletedTaskRecord struct {
	ID               int64  `json:"id"`
	OriginalTaskId   int64  `json:"originalTaskId"`
	TaskTypeId       int64  `json:"taskTypeId"`
	TaskTypeName     string `json:"taskTypeName"`
	TargetPath       string `json:"targetPath"`
	WorkingDirectory string `json:"workingDirectory,omitempty"`
	SourceCommand    string `json:"sourceCommand"`
	CommandArgs      string `json:"commandArgs,omitempty"`
	CompletedAt      string `json:"completedAt,omitempty"`
	CreatedAt        string `json:"createdAt,omitempty"`
}

CompletedTaskRecord represents a successfully executed task.

type Config

type Config struct {
	DefaultMode      string        `json:"defaultMode"`
	DefaultOutput    string        `json:"defaultOutput"`
	OutputDir        string        `json:"outputDir"`
	ExcludeDirs      []string      `json:"excludeDirs"`
	Notes            string        `json:"notes"`
	Release          ReleaseConfig `json:"release"`
	DashboardRefresh int           `json:"dashboardRefresh"`
}

Config holds application configuration loaded from JSON and CLI flags.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with sensible built-in defaults.

type CsharpKeyFile

type CsharpKeyFile struct {
	ID               int64  `json:"id"`
	CsharpMetadataID int64  `json:"csharpMetadataId"`
	FileType         string `json:"fileType"`
	FilePath         string `json:"filePath"`
	RelativePath     string `json:"relativePath"`
}

CsharpKeyFile represents a key configuration file in a C# project.

type CsharpProjectFile

type CsharpProjectFile struct {
	ID               int64  `json:"id"`
	CsharpMetadataID int64  `json:"csharpMetadataId"`
	FilePath         string `json:"filePath"`
	RelativePath     string `json:"relativePath"`
	FileName         string `json:"fileName"`
	ProjectName      string `json:"projectName"`
	TargetFramework  string `json:"targetFramework"`
	OutputType       string `json:"outputType"`
	Sdk              string `json:"sdk"`
}

CsharpProjectFile represents a .csproj or .fsproj discovered in a C# project.

type CsharpProjectMetadata

type CsharpProjectMetadata struct {
	ID                int64               `json:"id"`
	DetectedProjectID int64               `json:"detectedProjectId"`
	SlnPath           string              `json:"slnPath"`
	SlnName           string              `json:"slnName"`
	GlobalJsonPath    string              `json:"globalJsonPath"`
	SdkVersion        string              `json:"sdkVersion"`
	ProjectFiles      []CsharpProjectFile `json:"projectFiles"`
	KeyFiles          []CsharpKeyFile     `json:"keyFiles"`
}

CsharpProjectMetadata holds C#-specific metadata for a detected project.

type CsharpProjectRecord

type CsharpProjectRecord struct {
	DetectedProject
	CsharpMetadata *CsharpProjectMetadata `json:"csharpMetadata,omitempty"`
}

CsharpProjectRecord combines a DetectedProject with its C# metadata for JSON output.

type DashboardData

type DashboardData struct {
	Meta      DashboardMeta `json:"meta"`
	Branches  []BranchInfo  `json:"branches"`
	Tags      []TagInfo     `json:"tags"`
	Authors   []AuthorInfo  `json:"authors"`
	Commits   []CommitInfo  `json:"commits"`
	Frequency FrequencyData `json:"frequency"`
}

DashboardData is the top-level structure written to dashboard.json.

type DashboardMeta

type DashboardMeta struct {
	RepoName      string `json:"repoName"`
	GeneratedAt   string `json:"generatedAt"`
	Branch        string `json:"branch"`
	RemoteURL     string `json:"remoteURL"`
	TotalCommits  int    `json:"totalCommits"`
	TotalBranches int    `json:"totalBranches"`
	TotalTags     int    `json:"totalTags"`
	Limit         int    `json:"limit,omitempty"`
	Since         string `json:"since,omitempty"`
}

DashboardMeta holds repository-level metadata and generation context.

type DatabaseExport

type DatabaseExport struct {
	Version    string                 `json:"version"`
	ExportedAt string                 `json:"exportedAt"`
	Repos      []ScanRecord           `json:"repos"`
	Groups     []GroupExport          `json:"groups"`
	Releases   []ReleaseRecord        `json:"releases"`
	History    []CommandHistoryRecord `json:"history"`
	Bookmarks  []BookmarkRecord       `json:"bookmarks"`
}

DatabaseExport holds the complete database state for portable backup.

type DetectedProject

type DetectedProject struct {
	ID               int64  `json:"id"`
	RepoID           int64  `json:"repoId"`
	RepoName         string `json:"repoName"`
	ProjectTypeID    int64  `json:"projectTypeId"`
	ProjectType      string `json:"projectType"`
	ProjectName      string `json:"projectName"`
	AbsolutePath     string `json:"absolutePath"`
	RepoPath         string `json:"repoPath"`
	RelativePath     string `json:"relativePath"`
	PrimaryIndicator string `json:"primaryIndicator"`
	DetectedAt       string `json:"detectedAt"`
}

DetectedProject represents a project detected inside a Git repository.

type EnvPathEntry

type EnvPathEntry struct {
	Path string `json:"path"`
}

EnvPathEntry represents a managed PATH directory entry.

type EnvRegistry

type EnvRegistry struct {
	Variables []EnvVariable  `json:"variables"`
	Paths     []EnvPathEntry `json:"paths"`
}

EnvRegistry represents the top-level env-registry.json structure.

type EnvVariable

type EnvVariable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

EnvVariable represents a managed environment variable.

type FindNextRow

type FindNextRow struct {
	Repo           ScanRecord `json:"repo"`
	NextVersionTag string     `json:"nextVersionTag"`
	NextVersionNum int64      `json:"nextVersionNum"`
	Method         string     `json:"method"`
	ProbedAt       string     `json:"probedAt"`
}

FindNextRow is the result of joining Repo with its latest available VersionProbe (Phase 2.4). Used by `gitmap find-next` to surface every repo with a new tag without re-running the probe.

type FrequencyData

type FrequencyData struct {
	Daily   map[string]int `json:"daily"`
	Weekly  map[string]int `json:"weekly"`
	Monthly map[string]int `json:"monthly"`
}

FrequencyData holds pre-aggregated commit counts by time period.

type GoProjectMetadata

type GoProjectMetadata struct {
	ID                int64            `json:"id"`
	DetectedProjectID int64            `json:"detectedProjectId"`
	GoModPath         string           `json:"goModPath"`
	GoSumPath         string           `json:"goSumPath"`
	ModuleName        string           `json:"moduleName"`
	GoVersion         string           `json:"goVersion"`
	Runnables         []GoRunnableFile `json:"runnables"`
}

GoProjectMetadata holds Go-specific metadata for a detected project.

type GoProjectRecord

type GoProjectRecord struct {
	DetectedProject
	GoMetadata *GoProjectMetadata `json:"goMetadata,omitempty"`
}

GoProjectRecord combines a DetectedProject with its Go metadata for JSON output.

type GoRunnableFile

type GoRunnableFile struct {
	ID           int64  `json:"id"`
	GoMetadataID int64  `json:"goMetadataId"`
	RunnableName string `json:"runnableName"`
	FilePath     string `json:"filePath"`
	RelativePath string `json:"relativePath"`
}

GoRunnableFile represents a main.go entry point inside a Go project.

type Group

type Group struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Color       string `json:"color"`
	CreatedAt   string `json:"createdAt"`
}

Group represents a named collection of repositories.

type GroupExport

type GroupExport struct {
	Group
	RepoSlugs []string `json:"repoSlugs"`
}

GroupExport extends Group with its member repo slugs.

type GroupRepo

type GroupRepo struct {
	GroupID int64 `json:"groupId"`
	RepoID  int64 `json:"repoId"`
}

GroupRepo links a group to a repository.

type OverallStats

type OverallStats struct {
	TotalCommands   int            `json:"totalCommands"`
	UniqueCommands  int            `json:"uniqueCommands"`
	TotalSuccess    int            `json:"totalSuccess"`
	TotalFail       int            `json:"totalFail"`
	OverallFailRate float64        `json:"overallFailRate"`
	AvgDuration     int64          `json:"avgDurationMs"`
	Commands        []CommandStats `json:"commands"`
}

OverallStats holds the summary across all commands.

type PendingTaskRecord

type PendingTaskRecord struct {
	ID               int64  `json:"id"`
	TaskTypeId       int64  `json:"taskTypeId"`
	TaskTypeName     string `json:"taskTypeName"`
	TargetPath       string `json:"targetPath"`
	WorkingDirectory string `json:"workingDirectory,omitempty"`
	SourceCommand    string `json:"sourceCommand"`
	CommandArgs      string `json:"commandArgs,omitempty"`
	FailureReason    string `json:"failureReason,omitempty"`
	CreatedAt        string `json:"createdAt,omitempty"`
	UpdatedAt        string `json:"updatedAt,omitempty"`
}

PendingTaskRecord represents a task awaiting execution.

type ProfileConfig

type ProfileConfig struct {
	Active   string   `json:"active"`
	Profiles []string `json:"profiles"`
}

ProfileConfig holds the list of profiles and the active one.

type ProjectType

type ProjectType struct {
	ID          int64  `json:"id"`
	Key         string `json:"key"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

ProjectType represents a supported project type in the reference table.

type ReleaseConfig

type ReleaseConfig struct {
	Targets   []ReleaseTarget `json:"targets"`
	Checksums bool            `json:"checksums"`
	Compress  bool            `json:"compress"`
}

ReleaseConfig holds release-specific configuration from config.json.

type ReleaseRecord

type ReleaseRecord struct {
	ID           int64  `json:"id"`
	RepoID       int64  `json:"repoId"`
	Version      string `json:"version"`
	Tag          string `json:"tag"`
	Branch       string `json:"branch"`
	SourceBranch string `json:"sourceBranch"`
	CommitSha    string `json:"commitSha"`
	Changelog    string `json:"changelog"`
	Notes        string `json:"notes"`
	IsDraft      bool   `json:"isDraft"`
	IsPreRelease bool   `json:"isPreRelease"`
	IsLatest     bool   `json:"isLatest"`
	Source       string `json:"source"`
	CreatedAt    string `json:"createdAt"`
}

ReleaseRecord holds release metadata stored in the database. v17: RepoId FK to Repo.RepoId (see spec/04-generic-cli/24-release-repo-relationship.md).

type ReleaseTarget

type ReleaseTarget struct {
	GOOS   string `json:"goos"`
	GOARCH string `json:"goarch"`
}

ReleaseTarget represents a single GOOS/GOARCH pair in config.json.

type RepoVersionHistoryRecord

type RepoVersionHistoryRecord struct {
	ID             int64  `json:"id"`
	RepoID         int64  `json:"repoId"`
	FromVersionTag string `json:"fromVersionTag"`
	FromVersionNum int    `json:"fromVersionNum"`
	ToVersionTag   string `json:"toVersionTag"`
	ToVersionNum   int    `json:"toVersionNum"`
	FlattenedPath  string `json:"flattenedPath,omitempty"`
	CreatedAt      string `json:"createdAt,omitempty"`
}

RepoVersionHistoryRecord represents a single version transition for a repo.

type SSHKey

type SSHKey struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	PrivatePath string `json:"privatePath"`
	PublicKey   string `json:"publicKey"`
	Fingerprint string `json:"fingerprint"`
	Email       string `json:"email"`
	CreatedAt   string `json:"createdAt"`
}

SSHKey represents a stored SSH key pair.

type ScanCache

type ScanCache struct {
	Dir           string `json:"dir"`
	ConfigPath    string `json:"configPath"`
	Mode          string `json:"mode"`
	Output        string `json:"output"`
	OutFile       string `json:"outFile"`
	OutputPath    string `json:"outputPath"`
	GithubDesktop bool   `json:"githubDesktop"`
	OpenFolder    bool   `json:"openFolder"`
	Quiet         bool   `json:"quiet"`
}

ScanCache stores the flags used for the last scan so rescan can replay them.

type ScanFolder

type ScanFolder struct {
	ID            int64  `json:"id"`
	AbsolutePath  string `json:"absolutePath"`
	Label         string `json:"label"`
	Notes         string `json:"notes"`
	LastScannedAt string `json:"lastScannedAt"`
	CreatedAt     string `json:"createdAt"`
}

ScanFolder is a root path that `gitmap scan` was invoked against. Repos record the ScanFolderId of their most recent scan via the nullable Repo.ScanFolderId column.

type ScanRecord

type ScanRecord struct {
	ID               int64  `json:"id"                csv:"id"`
	Slug             string `json:"slug"              csv:"slug"`
	RepoID           string `json:"repoId"            csv:"repoId"`
	RepoName         string `json:"repoName"          csv:"repoName"`
	HTTPSUrl         string `json:"httpsUrl"          csv:"httpsUrl"`
	SSHUrl           string `json:"sshUrl"            csv:"sshUrl"`
	DiscoveredURL    string `json:"discoveredUrl"     csv:"discoveredUrl"`
	Branch           string `json:"branch"            csv:"branch"`
	BranchSource     string `json:"branchSource"      csv:"branchSource"`
	RelativePath     string `json:"relativePath"      csv:"relativePath"`
	AbsolutePath     string `json:"absolutePath"      csv:"absolutePath"`
	CloneInstruction string `json:"cloneInstruction"  csv:"cloneInstruction"`
	Notes            string `json:"notes"             csv:"notes"`
	Depth            int    `json:"depth"             csv:"depth"`
	Transport        string `json:"transport"         csv:"transport"`
}

ScanRecord holds all information about a discovered Git repository.

Depth is the directory level at which the repo was found, counted from the scan root (0 = the scan root itself, 1 = its immediate children, …). Surfaced in CSV / JSON output so users can verify when DefaultMaxDepth (or a custom --max-depth) prevented walking into deeper directories: a row with Depth == cap is a candidate for a deeper rescan.

Transport is the URL-scheme bucket the repo's discovered remote falls into: one of "ssh" | "https" | "other". Surfaced as a CSV column / JSON field so users can filter clones by transport with a one-liner (`awk -F, '$13=="ssh"' gitmap.csv`, `jq '.[]| select(.transport=="ssh")' gitmap.json`). Mirrors the same three- bucket collapse that the clone-from terminal summary uses (see clonefrom.TransportTally) so the two views stay in lockstep.

type TagInfo

type TagInfo struct {
	Name        string `json:"name"`
	SHA         string `json:"sha"`
	Date        string `json:"date"`
	CommitCount int    `json:"commitCount"`
}

TagInfo describes a single tag with its distance from the previous tag.

type TaskEntry

type TaskEntry struct {
	Name     string `json:"name"`
	Source   string `json:"source"`
	Dest     string `json:"dest"`
	Interval int    `json:"interval,omitempty"`
}

TaskEntry represents a named file-sync watch task.

type TaskFile

type TaskFile struct {
	Tasks []TaskEntry `json:"tasks"`
}

TaskFile represents the top-level tasks.json structure.

type TaskTypeRecord

type TaskTypeRecord struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

TaskTypeRecord represents a task category (Delete, Remove).

type TempRelease

type TempRelease struct {
	ID             int64  `json:"id"`
	Branch         string `json:"branch"`
	VersionPrefix  string `json:"versionPrefix"`
	SequenceNumber int    `json:"sequenceNumber"`
	CommitSha      string `json:"commit"`
	CommitMessage  string `json:"commitMessage"`
	CreatedAt      string `json:"createdAt"`
}

TempRelease represents a temporary release branch record.

type TransactionActionRecord

type TransactionActionRecord struct {
	ID            int64  `json:"id"`
	TransactionID int64  `json:"transactionId"`
	Seq           int64  `json:"seq"`
	Kind          string `json:"kind"`
	ForwardJSON   string `json:"forwardJson"`
	ReverseJSON   string `json:"reverseJson"`
	BackupRef     int64  `json:"backupRef,omitempty"`
	AppliedAt     int64  `json:"appliedAt"`
	RevertedAt    int64  `json:"revertedAt,omitempty"`
}

TransactionActionRecord is one TransactionAction row.

type TransactionFileRecord

type TransactionFileRecord struct {
	ID            int64  `json:"id"`
	TransactionID int64  `json:"transactionId"`
	RelPath       string `json:"relPath"`
	AbsPath       string `json:"absPath"`
	BackupPath    string `json:"backupPath"`
	ByteSize      int64  `json:"byteSize"`
	Sha256        string `json:"sha256"`
	Action        string `json:"action"`
}

TransactionFileRecord captures one file gitmap snapshotted to the per-transaction backup directory before mutating it on disk.

Action is one of TxnAction* constants ("delete", "edit", "rename").

type TransactionRecord

type TransactionRecord struct {
	ID             int64  `json:"id"`
	Kind           string `json:"kind"`
	Status         string `json:"status"`
	Argv           string `json:"argv"`
	Cwd            string `json:"cwd"`
	CreatedAt      int64  `json:"createdAt"`
	CommittedAt    int64  `json:"committedAt,omitempty"`
	RevertedAt     int64  `json:"revertedAt,omitempty"`
	ReverseSummary string `json:"reverseSummary"`
	RepoSlug       string `json:"repoSlug,omitempty"`
	GitSha         string `json:"gitSha,omitempty"`
}

TransactionRecord is one row of the "Transaction" master journal.

One row is written per state-mutating gitmap command (clone, mv, merge-*, fix-repo, history-*, ...). Status flows pending → committed (or pending → aborted on failure; committed → reverted by `gitmap revert --txn <id>`).

type VSCodeProject

type VSCodeProject struct {
	ID         int64    `json:"id"`
	RootPath   string   `json:"rootPath"`
	Name       string   `json:"name"`
	Paths      []string `json:"paths"`
	Enabled    bool     `json:"enabled"`
	Profile    string   `json:"profile"`
	LastSeenAt string   `json:"lastSeenAt"`
	CreatedAt  string   `json:"createdAt"`
	UpdatedAt  string   `json:"updatedAt"`
}

VSCodeProject is one row in the VSCodeProject table — the gitmap-side source of truth for entries synced into VS Code Project Manager's projects.json.

`tags` is not stored on purpose: it lives only inside projects.json and is preserved across syncs.

`Paths` (multi-root extras, schema v20+) IS stored, JSON-encoded as a TEXT column in SQLite, and surfaced here as a decoded []string. The DB list is UNIONed with any user-added paths from the VS Code UI on every sync — gitmap never silently removes a user-added entry.

type VersionProbe

type VersionProbe struct {
	ID             int64  `json:"id"`
	RepoID         int64  `json:"repoId"`
	ProbedAt       string `json:"probedAt"`
	NextVersionTag string `json:"nextVersionTag"`
	NextVersionNum int64  `json:"nextVersionNum"`
	Method         string `json:"method"`
	IsAvailable    bool   `json:"isAvailable"`
	Error          string `json:"error"`
}

VersionProbe stores the result of a single HEAD-then-clone version probe for a repo. Empty in Phase 2.1; populated from Phase 2.3 onward.

type ZipGroup

type ZipGroup struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	ArchiveName string `json:"archiveName"`
	CreatedAt   string `json:"createdAt"`
}

ZipGroup represents a named collection of files/folders for archiving.

type ZipGroupItem

type ZipGroupItem struct {
	GroupID      int64  `json:"groupId"`
	RepoPath     string `json:"repoPath"`
	RelativePath string `json:"relativePath"`
	FullPath     string `json:"fullPath"`
	IsFolder     bool   `json:"isFolder"`
	// Path returns FullPath for backward compatibility with zip archive logic.
	Path string `json:"-"`
}

ZipGroupItem links a file or folder path to a zip group.

func (*ZipGroupItem) ResolvePath

func (z *ZipGroupItem) ResolvePath()

ResolvePath sets the Path field from FullPath for archive operations.

Jump to

Keyboard shortcuts

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