bobgit

package
v0.0.0-...-b7a57f2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

bob git

git cmd implementation status
bob clone 100%
git status 100%
git add 100%
git commit 100%
git push wip
git pull wip
git stash wip

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOutsideBobWorkspace = fmt.Errorf("Not allowed, path pointing outside of Bob workspace.")
	ErrCouldNotFindGitDir  = fmt.Errorf("Could not find a .git folder")
)
View Source
var CleanWorkingDirMessage = "nothing to commit, working trees are clean."
View Source
var ErrEmptyCommitMessage = fmt.Errorf("aaaaaa")

Functions

func Add

func Add(targets ...string) (err error)

Add run git add commands by travsersing all the repositories inside the bob workspace.

if target is provided "." it selects all modified files in all repos by running `git add . --dry-run`, then run `git add {filename}` for all selected files.

else for subdirectory e.g. `subdir/.` it selectes all files on that subdir and also all repository under that subtree and run `git add --dry-run` followed by `git add {filename}`

else for specific file under any repository on bob workspace select the specific repository and run `git add --dry-run` followed by `git add {filename}`.

Run all the steps iterativley for multiple targets.

func Commit

func Commit(message string) (s string, err error)

Commit executes `git commit -m ${message}` in all repositories.

indifferent of the subdirectories and subrepositories, it walks through all the repositories starting from bobroot and run `git commit -m {message}` command.

Only returns user messages in case of nothing to commit.

func FprintCommitOutput

func FprintCommitOutput(reponame string, output []byte, maxlen int, success bool) *bytes.Buffer

FprintCommitOutput formats output buffer from every repository commit output

func Status

func Status() (s *status.S, err error)

Status executes `git status -porcelain` in all repositories first level repositories found inside a .bob filtree. It parses the output of each call and creates a object containing status infos for all of them combined. The result is similar to what `git status` would print but visualy optimised for the multi repository case.

func UntrackedRepoMessage

func UntrackedRepoMessage(repolist []string) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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