(configuration config.Configuration)
| 1099 | } |
| 1100 | |
| 1101 | func 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 | |
| 1130 | func version() { |
| 1131 | say.Say("v" + versionNumber) |
no test coverage detected