gitinit

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gitinit is the one place Sidecar initializes a Git repository. Git status, Configuration's Add Project form, and first-run onboarding all call it rather than spawning `git init` themselves.

Index

Constants

This section is empty.

Variables

View Source
var SidecarGitignoreEntries = []string{
	".todos/",
	".sidecar/",
	".sidecar-agent",
	".sidecar-task",
	".sidecar-pr",
	".sidecar-start.sh",
	".sidecar-base",
	".td-root",
}

SidecarGitignoreEntries lists sidecar state paths that should be ignored when the user explicitly initializes a repository from Sidecar. Opening an existing repository never mutates its .gitignore.

Functions

func EnsureGitignore

func EnsureGitignore(workDir string, entries []string) error

EnsureGitignore appends missing entries to .gitignore in workDir.

func Init

func Init(dir string) (root string, err error)

Init runs `git init -b main` in dir and ensures sidecar local-state paths are ignored. Root is set when git init succeeded. A non-nil error with a non-empty Root is a non-fatal .gitignore warning; an empty Root is fatal.

func IsRepository

func IsRepository(dir string) bool

IsRepository reports whether dir is inside a Git work tree. It is meant for a tea.Cmd, not the render path: it spawns git.

func Root

func Root(dir string) (string, error)

Root returns the top-level directory of the repository containing dir.

Types

type ReadyMsg

type ReadyMsg struct {
	Root string
}

ReadyMsg reports that a Git repository now exists at Root. Plugins that depend on worktrees or status reload from it without an app restart.

Jump to

Keyboard shortcuts

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