cliutil

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cliutil provides helpers for scripting git operations on a local working tree, such as staging files that were deleted outside of git.

Index

Constants

View Source
const GitCmdStatusShort = "git status --porcelain"

GitCmdStatusShort is the git command whose output GitStatusShortLines returns. The porcelain format is stable across git versions.

Variables

This section is empty.

Functions

func GitRmDeletedFile

func GitRmDeletedFile(filename, dir string) error

GitRmDeletedFile writes the commands returned by GitRmDeletedLines to filename, one per line, replacing any existing file.

func GitRmDeletedLines

func GitRmDeletedLines(dir string) ([]string, error)

GitRmDeletedLines returns one `git rm <path>` command per file that was deleted in the working tree of the repository at dir but is still tracked, so that running them stages the deletions. Paths are quoted as git prints them.

func GitStatusShortLines

func GitStatusShortLines(dir string) ([]string, error)

GitStatusShortLines returns the non-empty lines of `git status --porcelain` for the repository at dir.

Types

This section is empty.

Directories

Path Synopsis
cmd
bulk_git_rm command
Command bulk_git_rm prints a `git rm` command for every tracked file that was deleted in a repository's working tree, so the deletions can be staged in one step.
Command bulk_git_rm prints a `git rm` command for every tracked file that was deleted in a repository's working tree, so the deletions can be staged in one step.

Jump to

Keyboard shortcuts

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