Documentation
¶
Overview ¶
Command `gitmap add lfs-install`.
Two-step operation:
- Run `git lfs install --local` so the current repo has the LFS pre-push / clean / smudge hooks wired up. This is itself idempotent — Git LFS treats repeat invocations as no-ops.
- Resolve the `lfs/common` template (overlay > embed) and merge its body into ./.gitattributes via templates.Merge, which uses a gitmap-managed marker block so the second and later runs are byte-stable no-ops when the template hasn't changed.
Why a separate command from `gitmap lfs-common`? `lfs-common` shells out to `git lfs track` per-pattern and writes whatever line format `git lfs` decides on. `add lfs-install` is the template-driven path: the bytes written to .gitattributes come from the curated, versioned `lfs/common.gitattributes` asset (audit-trailed `# source:` header) and can be overridden by a user file at ~/.gitmap/templates/lfs/common.gitattributes.
Package cmd — amend.go handles flag parsing and orchestration for the amend command.
Package cmd — amendaudit.go handles audit JSON writing and DB persistence.
Package cmd — amendexec.go handles git operations for the amend command.
Package cmd — amendexecprint.go handles output and display for amend operations.
Package cmd — amendlist.go handles the amend-list command.
Package cmd implements the CLI commands for gitmap.
Package cmd — clonenextcrossdir.go implements the cross-dir `gitmap cn <repo> <version>` form: chdir into the named repo, run the existing clone-next pipeline, then chdir back.
Backward compatibility: `gitmap cn vX.Y.Z` (single positional) keeps operating on the current directory's repo as before.
Package cmd implements the CLI commands for gitmap.
Package cmd — haschange.go implements `gitmap has-change (hc) <repo>`.
Prints "true" or "false" depending on whether the named repo has uncommitted changes (default), is ahead of origin, or is behind origin. Use --mode to switch dimensions; --all prints structured output covering all three.
Examples:
gitmap hc gitmap -> true | false (dirty working tree) gitmap hc gitmap --mode=ahead -> true | false (local commits not pushed) gitmap hc gitmap --mode=behind -> true | false (remote commits not pulled) gitmap hc gitmap --all -> dirty=true ahead=false behind=true
Package cmd — latest-branch command handler.
Package cmd — latest-branch output formatters.
Package cmd — latest-branch resolve helpers.
Package cmd — llmdocs.go generates a consolidated LLM.md reference file.
Package cmd — llmdocscommands.go writes the command reference tables.
Package cmd — llmdocsgroups.go defines command groups for LLM doc generation.
Package cmd — llmdocsheader.go writes the header and architecture sections.
Package cmd — llmdocssections.go writes the remaining LLM.md sections.
Package cmd — migrate.go handles automatic migration of legacy directories.
Package cmd — projectrepos.go handles project type query commands.
Package cmd — projectreposoutput.go formats project query output.
Package cmd implements the CLI commands for gitmap.
Package cmd implements the CLI commands for gitmap.
Package cmd implements the CLI commands for gitmap.
Package cmd — releaserebase.go implements the cross-dir `gitmap r <repo> <version>` form: pull --rebase the named repo, then run the standard release pipeline, then chdir back to the original directory.
Backward compatibility: `gitmap r vX.Y.Z` (single positional arg) keeps running an in-place release of the current repo. The new behavior only triggers when TWO positional args are given AND the first does NOT look like a version string (e.g. v3.31.0, 3.31.0).
Package cmd implements the CLI commands for gitmap.
Package cmd — scanbenchmark.go captures per-phase scan timings and writes them to a benchmark log so users can diagnose slow scans without us having to ask. Each scan invocation appends a fresh, timestamped block to .gitmap/output/scan-benchmark.log alongside the binary version.
Why a file (not just stdout): users routinely report "scan is slow" with no reproducible numbers. The log gives them — and us — a record of exactly which phase ate the wall clock, across every run.
Package cmd — scanprojectoutput.go writes project-specific JSON files.
Package cmd — scanprojects.go handles project detection during scan.
Package cmd — scanprojectsmeta.go handles Go and C# metadata persistence.
Package cmd — seowrite.go handles flag parsing and orchestration for seo-write.
Package cmd — seowritecreate.go scaffolds a sample seo-templates.json.
Package cmd — seowritecsv.go handles CSV parsing for seo-write.
Package cmd — seowriteloop.go handles the commit loop, rotation, and timing.
Package cmd — seowritetemplate.go handles template loading and placeholder substitution.
Package cmd — sshexisting.go handles the case where an SSH key already exists on disk when `gitmap ssh` is invoked. Instead of forwarding the stdin "Overwrite (y/n)?" prompt to `ssh-keygen` (which fails non-interactively and confuses users), we detect the existing key UP FRONT, print the public key + fingerprint, and exit cleanly. Pass `--force` to regenerate.
Command `gitmap templates init <lang> [<lang>...] [--lfs] [--dry-run] [--force]`.
Scaffolds .gitignore and .gitattributes for one or more languages by resolving the corresponding embedded (or user-overlay) templates and merging them into the target files via templates.Merge — the same idempotent marker-block primitive that powers `add lfs-install`.
Behavior summary:
- For each <lang>, ignore/<lang>.gitignore is REQUIRED. Missing → hard error (exit 1) with a one-liner pointing at `templates list`.
- attributes/<lang>.gitattributes is OPTIONAL. Missing → soft skip with a dim "no attributes template for <lang>" notice. This matches the embed corpus (every lang has ignore, only some have attributes).
- --lfs additionally merges lfs/common.gitattributes into .gitattributes. Reuses templates.Merge with tag "lfs/common" so the block is interchangeable with `gitmap add lfs-install`.
- --dry-run prints every block that WOULD be written and exits without touching disk. Outcome verbs reflect what would happen (created / would update / would insert).
- --force replaces any pre-existing target file outright with a fresh gitmap-managed block, discarding hand edits OUTSIDE the markers. Without --force, Merge preserves non-marker content and either updates the existing block in place or appends one — see merge.go.
Operates from CWD. Does NOT require being inside a git repo (scaffolding before `git init` is a legitimate workflow). The --lfs path also does NOT shell out to `git lfs install` — that's `add lfs-install`'s job. `templates init --lfs` is purely a template-merge operation.
Package cmd implements CLI command handlers for gitmap.
Package cmd implements CLI command handlers for gitmap.
Package cmd — extra cleanup passes for update-cleanup.
These complement the pattern-based pass in updatecleanup_remove.go by targeting two artifact classes that don't fit the simple-glob model:
- The obsolete v2.90.0 drive-root forwarding shim (e.g. E:\gitmap.exe sitting at the literal drive root, NOT inside a gitmap\ subfolder).
- *.gitmap-tmp-* swap directories left by interrupted clones.
Both passes follow the spec/04-generic-cli/22-data-folder-deploy-and-cleanup.md contract (DFD-6, DFD-7).
Package cmd — Phase 3 of the self-update handoff chain.
Phase 1 (update.go): active gitmap.exe → handoff copy (gitmap-update-<pid>.exe) Phase 2 (update.go): handoff copy runs build/deploy via run.ps1 Phase 3 (this file): handoff copy spawns the freshly-deployed gitmap.exe
(a different file with no lock) detached, with a small delay, to run `update-cleanup`. Only the deployed binary can safely remove the still-locked handoff copy and the just-renamed *.exe.old.
See spec/08-generic-update/06-cleanup.md and spec/03-general/02f-self-update-orchestration.md for the full sequence.
Index ¶
- func AliasAsRecords() []store.AliasWithRepo
- func CheckSequenceRange(start, count, digits int) error
- func FormatSeq(seq, digits int) string
- func GetAliasPath() string
- func GetAliasSlug() string
- func HasAlias() bool
- func ParsePrettyFlag(args []string) ([]string, render.PrettyMode)
- func ParseVersionPatternSafe(pattern string) (string, int)
- func PrintBinaryLocations()
- func ResolveTRBranchExported(version string) string
- func Run()
- type CloneNextFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AliasAsRecords ¶
func AliasAsRecords() []store.AliasWithRepo
AliasAsRecords returns the alias as a single-element ScanRecord slice. Useful for commands that operate on a list of repos.
func CheckSequenceRange ¶
CheckSequenceRange validates sequence range without os.Exit.
func GetAliasPath ¶
func GetAliasPath() string
GetAliasPath returns the resolved alias path if set, or empty string.
func GetAliasSlug ¶
func GetAliasSlug() string
GetAliasSlug returns the resolved alias slug if set, or empty string.
func ParsePrettyFlag ¶
func ParsePrettyFlag(args []string) ([]string, render.PrettyMode)
ParsePrettyFlag pulls --pretty / --no-pretty out of args and returns the cleaned slice + the resolved render.PrettyMode. Accepted forms:
--pretty → PrettyOn --pretty=true → PrettyOn --pretty=on → PrettyOn --pretty=1 → PrettyOn --pretty=false → PrettyOff --pretty=off → PrettyOff --pretty=0 → PrettyOff --pretty=auto → PrettyAuto (explicit reset) --no-pretty → PrettyOff
When the same flag is repeated, the **last** occurrence wins (matches stdlib flag.Parse semantics). When neither appears, the returned mode is PrettyAuto so callers can rely on Decide()'s default ladder.
Unrecognized values fall through to PrettyAuto and the token is left in place so the downstream parser can produce a meaningful error.
func ParseVersionPatternSafe ¶
ParseVersionPatternSafe parses a version pattern without os.Exit.
func PrintBinaryLocations ¶
func PrintBinaryLocations()
PrintBinaryLocations prints the Active / Deployed / Config binary triplet to stdout. Called from bare `gitmap` (no args) and from the post-update readout. The output is suppressed when --no-banner is in os.Args or when the GITMAP_QUIET env var is set to "1".
Definitions (see spec/01-app/89-deploy-layout-and-binary-readout.md):
- Active = os.Executable() after filepath.EvalSymlinks. The file the OS actually loaded for this process.
- Deployed = <powershell.json.deployPath>/gitmap-cli/<binaryName> if it exists on disk; "(not found)" otherwise.
- Config = literal path the config declares, whether or not the file exists. Represents config intent.
func ResolveTRBranchExported ¶
ResolveTRBranchExported is an exported wrapper for testing resolveTRBranch.
Types ¶
type CloneNextFlags ¶
type CloneNextFlags struct {
VersionArg string
Delete bool
Keep bool
NoDesktop bool
CreateRemote bool
SSHKeyName string
Verbose bool
CSVPath string
All bool
// Force forces a flat clone even when the user's cwd IS the target
// folder. Triggers a chdir-to-parent before the existence check (to
// release Windows file locks) and DISABLES the versioned-folder
// fallback so the user gets either a flat layout or a clear error.
// See spec/01-app/87-clone-next-flatten.md.
Force bool
}
CloneNextFlags bundles every parsed flag from the clone-next command so the dispatcher in runCloneNext can branch on batch vs single mode without a 9-arg return list.
Source Files
¶
- addlfsinstall.go
- alias.go
- aliasops.go
- aliasresolve.go
- aliassuggest.go
- amend.go
- amendaudit.go
- amendexec.go
- amendexecprint.go
- amendlist.go
- as.go
- asops.go
- audit.go
- binarylocations.go
- bookmark.go
- bookmarklist.go
- bookmarkrun.go
- bookmarksave.go
- cd.go
- cddefault.go
- cdops.go
- changelog.go
- changeloggen.go
- changelogprint.go
- changelogwrap.go
- clearreleasejson.go
- clone.go
- clonenext.go
- clonenextbatch.go
- clonenextbatchdispatch.go
- clonenextcrossdir.go
- clonenextflags.go
- clonenexthistory.go
- clonenextpath.go
- clonereplace.go
- clonevscode.go
- code.go
- completion.go
- dashboard.go
- dbmigrate.go
- dbreset.go
- desktopsync.go
- diff.go
- diffprofiles.go
- diffprofilesops.go
- dispatchdiff.go
- dispatchmovemerge.go
- docs.go
- doctor.go
- doctorchecks.go
- doctordupbin.go
- doctorfixpath.go
- doctorformat.go
- doctorintegrity.go
- doctorsetup.go
- doctorsync.go
- doctorvalidate.go
- doctorversion.go
- doctorvscodepm.go
- dopending.go
- dopendingretry.go
- env.go
- envops.go
- envplatform_unix.go
- envregistry.go
- envvalidate.go
- exec.go
- execprint.go
- export.go
- findnext.go
- githubdesktop.go
- gomod.go
- gomodbranch.go
- gomodreplace.go
- group.go
- groupadd.go
- groupcreate.go
- groupdelete.go
- grouplist.go
- groupremove.go
- groupscoped.go
- groupshow.go
- hasanyupdates.go
- haschange.go
- helpcheck.go
- helpdashboard.go
- hints.go
- history.go
- historyreset.go
- importcmd.go
- install.go
- installcleancode.go
- installctxmenu.go
- installdetect.go
- installeddir.go
- installnpp.go
- installnppextract.go
- installobs.go
- installscripts.go
- installtools.go
- installverify.go
- installvscode.go
- installwt.go
- interactive.go
- jsonextract.go
- latestbranch.go
- latestbranchoutput.go
- latestbranchresolve.go
- lfscommon.go
- list.go
- listreleases.go
- listreleasesallrepos.go
- listreleasesload.go
- listversions.go
- listversionsutil.go
- llmdocs.go
- llmdocscommands.go
- llmdocsgroups.go
- llmdocsheader.go
- llmdocssections.go
- merge.go
- migrate.go
- move.go
- movemergeflags.go
- multigroup.go
- multigroupops.go
- pending.go
- pendingtaskhelper.go
- prettyflag.go
- probe.go
- profile.go
- profileops.go
- profileutil.go
- projectrepos.go
- projectreposoutput.go
- prune.go
- pruneops.go
- pull.go
- pullfilter.go
- pullparallel.go
- release.go
- releasealias.go
- releasealias_git.go
- releaseargs.go
- releaseautobump.go
- releaseautoregister.go
- releasebranch.go
- releasepending.go
- releasepersist.go
- releaserebase.go
- releasescan.go
- releaseself.go
- rescan.go
- reset.go
- revert.go
- revertscript.go
- root.go
- rootadd.go
- rootcore.go
- rootdata.go
- rootdispatch.go
- rootflags.go
- rootprojectrepos.go
- rootrelease.go
- roottooling.go
- rootusage.go
- rootusagecompact.go
- rootusageflags.go
- rootutility.go
- scan.go
- scanbenchmark.go
- scanimport.go
- scanoutput.go
- scanprogress.go
- scanprojectoutput.go
- scanprojects.go
- scanprojectsmeta.go
- selfinstall.go
- selfuninstall.go
- selfuninstallhandoff.go
- selfuninstallparts.go
- seowrite.go
- seowritecreate.go
- seowritecsv.go
- seowritegit.go
- seowriteloop.go
- seowritetemplate.go
- setsourcerepo.go
- setup.go
- setupconfig.go
- setupprintpathsnippet.go
- setupverify.go
- sf.go
- ssh.go
- sshcat.go
- sshconfig.go
- sshdelete.go
- sshexisting.go
- sshgen.go
- sshgenutil.go
- sshlist.go
- stats.go
- status.go
- statusformat.go
- statusprint.go
- task.go
- taskfilter.go
- taskops.go
- tasksync.go
- templatescli.go
- templatesinit.go
- temprelease.go
- tempreleaseexport_test_helpers.go
- tempreleaselist.go
- tempreleaseops.go
- tempreleaseremove.go
- uninstall.go
- update.go
- updatecleanup.go
- updatecleanup_extra.go
- updatecleanup_paths.go
- updatecleanup_remove.go
- updatehandoff_phase3.go
- updaterepo.go
- updatereport.go
- updatescript.go
- versionhistory.go
- vscodepmpath.go
- vscodepmsync.go
- watch.go
- watchformat.go
- watchops.go
- zipgroup.go
- zipgroupcreate.go
- zipgroupops.go
- zipgroupshow.go