pathspec

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRepoNotFound = fmt.Errorf("Repository name not found in target path repository list")

Functions

This section is empty.

Types

type P

type P struct {
	// contains filtered or unexported fields
}

P, stores the pathspec attribute for git intended to be used for the multi repo case.

func New

func New(path string) *P

func (*P) GetRelativePathspec

func (p *P) GetRelativePathspec(reponame string) (string, error)

GetRelativePathspec returns the relative pathspec from the internal map.

func (*P) SelectReposByPath

func (p *P) SelectReposByPath(repolist []string) []string

SelectReposByPath filter the repos from all the repository list by the pathspec where git add command will be executed.

Select all repos in case of target "." and set pathspecc to "." for all repos.

type RepoPathspecMap

type RepoPathspecMap map[string]string

map the repo as key and pathspec as value

where repository is relative to the bobroot and pathspec is relative to the repository.

func ComputePossibleRepos

func ComputePossibleRepos(path string) RepoPathspecMap

ComputePossibleRepos Compute all the possible repository path from the provided path starting from bobroot inside bob workspace and returns a map of string where key is repository path and value is the relative path from that repository.

repositories can be filtered later from the computed repository paths.

Example:

'bobroot/sample/path' => {".": 'bobroot/sample/path', "bobroot": 'sample/path', "bobroot/sample": 'path', ..}

can be interpreted this way, if the selected repository path is `bobroot/sample`, then pathspec for that target path would be only `path`, and so on.

Jump to

Keyboard shortcuts

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