MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / showNext

Function showNext

mob.go:1101–1128  ·  view source on GitHub ↗
(configuration config.Configuration)

Source from the content-addressed store, hash-verified

1099}
1100
1101func showNext(configuration config.Configuration) {
1102 say.Debug("determining next person based on previous changes")
1103 gitUserName := gitUserName()
1104 if gitUserName == "" {
1105 say.Warning("failed to detect who's next because you haven't set your git user name")
1106 say.Fix("To fix, use", "git config --global user.name \"Your Name Here\"")
1107 return
1108 }
1109
1110 currentBaseBranch, currentWipBranch := determineBranches(gitCurrentBranch(), gitBranches(), configuration)
1111 commitsBaseWipBranch := currentBaseBranch.String() + ".." + currentWipBranch.String()
1112
1113 changes := silentgit("--no-pager", "log", commitsBaseWipBranch, "--pretty=format:%an", "--abbrev-commit")
1114 lines := strings.Split(strings.Replace(changes, "\r\n", "\n", -1), "\n")
1115 numberOfLines := len(lines)
1116 say.Debug("there have been " + strconv.Itoa(numberOfLines) + " changes")
1117 say.Debug("current git user.name is '" + gitUserName + "'")
1118 if numberOfLines < 1 {
1119 return
1120 }
1121 nextTypist, previousCommitters := findNextTypist(lines, gitUserName)
1122 if nextTypist != "" {
1123 if len(previousCommitters) != 0 {
1124 say.Info("Committers after your last commit: " + strings.Join(previousCommitters, ", "))
1125 }
1126 say.Info("***" + nextTypist + "*** is (probably) next.")
1127 }
1128}
1129
1130func version() {
1131 say.Say("v" + versionNumber)

Callers 1

nextFunction · 0.85

Calls 11

DebugFunction · 0.92
WarningFunction · 0.92
FixFunction · 0.92
InfoFunction · 0.92
gitUserNameFunction · 0.85
determineBranchesFunction · 0.85
gitCurrentBranchFunction · 0.85
gitBranchesFunction · 0.85
silentgitFunction · 0.85
findNextTypistFunction · 0.85
StringMethod · 0.80

Tested by

no test coverage detected