(currentBaseBranch Branch, currentWipBranch Branch, configuration config.Configuration)
| 1028 | } |
| 1029 | |
| 1030 | func sayLastCommitsList(currentBaseBranch Branch, currentWipBranch Branch, configuration config.Configuration) { |
| 1031 | commitsBaseWipBranch := currentBaseBranch.String() + ".." + currentWipBranch.String() |
| 1032 | log, err := silentgitignorefailure("--no-pager", "log", commitsBaseWipBranch, "--pretty=format:%h %cr <%an>", "--abbrev-commit") |
| 1033 | if err != nil { |
| 1034 | commitsBaseWipBranch = currentBaseBranch.remote(configuration).String() + ".." + currentWipBranch.String() |
| 1035 | log = silentgit("--no-pager", "log", commitsBaseWipBranch, "--pretty=format:%h %cr <%an>", "--abbrev-commit") |
| 1036 | } |
| 1037 | lines := strings.Split(log, "\n") |
| 1038 | if len(lines) > 5 { |
| 1039 | say.Info("wip branch '" + currentWipBranch.String() + "' contains " + strconv.Itoa(len(lines)) + " commits. The last 5 were:") |
| 1040 | lines = lines[:5] |
| 1041 | } |
| 1042 | ReverseSlice(lines) |
| 1043 | output := strings.Join(lines, "\n") |
| 1044 | say.Say(output) |
| 1045 | } |
| 1046 | |
| 1047 | func ReverseSlice(s interface{}) { |
| 1048 | size := reflect.ValueOf(s).Len() |
no test coverage detected