changeSegment returns a string like "complete task 042" or "add tasks 045, 046".
(verb string, tasks []*model.Task)
| 267 | |
| 268 | // changeSegment returns a string like "complete task 042" or "add tasks 045, 046". |
| 269 | func changeSegment(verb string, tasks []*model.Task) string { |
| 270 | ids := make([]string, len(tasks)) |
| 271 | for i, t := range tasks { |
| 272 | ids[i] = t.ID |
| 273 | } |
| 274 | if len(tasks) == 1 { |
| 275 | return fmt.Sprintf("%s task %s", verb, ids[0]) |
| 276 | } |
| 277 | return fmt.Sprintf("%s tasks %s", verb, strings.Join(ids, ", ")) |
| 278 | } |
| 279 | |
| 280 | // buildMixedBody creates the body section for mixed-type commit messages. |
| 281 | // Each category gets a section with task titles (and subtasks for completed). |
no outgoing calls