Documentation ¶
Index ¶
- func AttrStr(label string, value string) string
- func BaseOptsStr(baseOpts BaseOptions) string
- func CalcDiffPercStr(curValue int, prevValue int) string
- func CalcDiffStr(curValue int, prevValue int) string
- func CalcPercStr(value int, total int) string
- func CommitInfoToCommitIds(cinfos []CommitInfo) []string
- func DiffContents(src string, dst string) []diffmatchpatch.Diff
- func ExecCheckPrereqs() error
- func ExecCommitIdInDateRange(repoDir string, branch string, sinceDate string, untilDate string) ([]string, error)
- func ExecDiffIsBinary(repoDir string, commitId string, filePath string) (bool, error)
- func ExecDiffTree(repoDir string, commitId1 string) ([]string, error)
- func ExecListTree(repoDir string, commitId string) ([]string, error)
- func ExecPreviousCommitIdForFile(repoDir string, commitId string, filePath string) (string, error)
- func ExecShell(workingDir string, command string) (string, error)
- func ExecShellTimeout(workingDir string, command string, timeout time.Duration, ...) (string, error)
- func ExecShellf(workingDir string, command string, args ...interface{}) (string, error)
- func ExecTreeFileSize(repoDir string, commitId string, filePath string) (int, error)
- func GetCmdOutput(cmd *cmd.Cmd) string
- func JoinWithLimit(values []string, separator string, limit int) string
- func ResolveTestOwnershipDuplicatesRepo() (string, error)
- func ResolveTestOwnershipRepo() (string, error)
- func ShowProgress(progressChan <-chan ProgressInfo)
- type BaseOptions
- type BlameLine
- type CacheDB
- type CommitInfo
- func ExecGetCommitsInCommitRange(repoDir string, branch string, sinceCommit string, untilCommit string) ([]CommitInfo, error)
- func ExecGetCommitsInDateRange(repoDir string, branch string, since string, until string) ([]CommitInfo, error)
- func ExecGetLastestCommit(repoDir string, branch string, sinceDate string, untilDate string) (*CommitInfo, error)
- func ExecGitCommitInfo(repoDir string, commitId string) (CommitInfo, error)
- type DiffEntry
- type DiffOp
- type DuplicateLineTracker
- type LineGroup
- type LineSource
- type LineText
- type Lines
- type ProgressInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseOptsStr ¶
func BaseOptsStr(baseOpts BaseOptions) string
func CalcDiffPercStr ¶
func CalcDiffStr ¶
func CalcPercStr ¶
func CommitInfoToCommitIds ¶
func CommitInfoToCommitIds(cinfos []CommitInfo) []string
func DiffContents ¶
func DiffContents(src string, dst string) []diffmatchpatch.Diff
FIXME remove later if not used
func ExecCheckPrereqs ¶
func ExecCheckPrereqs() error
func ExecCommitIdInDateRange ¶
func ExecDiffIsBinary ¶
func ExecShellTimeout ¶
func ExecShellTimeout(workingDir string, command string, timeout time.Duration, expectedExitCodes []int) (string, error)
ExecShellTimeout execute a shell command (like bash -c 'your command') with a timeout. After that time, the process will be cancelled
func ExecShellf ¶
ExecShellf execute a shell command (like bash -c 'your command') but with format replacements
func ExecTreeFileSize ¶
func GetCmdOutput ¶
GetCmdOutput join stdout and stderr in a single string from Cmd
func ShowProgress ¶
func ShowProgress(progressChan <-chan ProgressInfo)
Types ¶
type BaseOptions ¶
type BaseOptions struct { Branch string `json:"branch"` FilesRegex string `json:"files_regex"` FilesNotRegex string `json:"files_not_regex"` AuthorsRegex string `json:"authors_regex"` AuthorsNotRegex string `json:"authors_not_regex"` RepoDir string `json:"repo_dir"` CacheFile string `json:"cache_file"` CacheTTLSeconds int `json:"cache_ttl_seconds"` }
type BlameLine ¶
type BlameLine struct { // AuthorName is the name of the last author that modified the line AuthorName string // AuthorMail is the mail of the last author that modified the line AuthorMail string // Date is when the original text of the line was introduced AuthorDate time.Time // Hash is the commit hash that introduced the original line CommitId string LineContents string }
type CommitInfo ¶
type CommitInfo struct { AuthorName string `json:"author_name"` AuthorMail string `json:"author_mail"` Date time.Time `json:"date"` CommitId string `json:"commit_id"` }
func ExecGetLastestCommit ¶
func ExecGitCommitInfo ¶
func ExecGitCommitInfo(repoDir string, commitId string) (CommitInfo, error)
type DuplicateLineTracker ¶
type DuplicateLineTracker struct {
// contains filtered or unexported fields
}
Attention: this utility will handle a lot of memory and a lot of calls Be careful about anything you are going to store and always think about optimization
func NewDuplicateLineTracker ¶
func NewDuplicateLineTracker() *DuplicateLineTracker
func (*DuplicateLineTracker) AddLine ¶
func (d *DuplicateLineTracker) AddLine(contents string, source LineSource) ([]LineSource, bool)
Add a new line to tracker. If line is too short, it's is ignored and nil is returned This is thread safe, but can slow down parallelism in current implementation If string has string "\\n" (not \n), it will be split into distinct lines during ignore analysis
func (*DuplicateLineTracker) GroupDuplicatedLines ¶
func (d *DuplicateLineTracker) GroupDuplicatedLines() []LineGroup