MCPcopy Create free account
hub / github.com/driangle/taskmd / changeSegment

Function changeSegment

apps/cli/internal/cli/commit_msg.go:269–278  ·  view source on GitHub ↗

changeSegment returns a string like "complete task 042" or "add tasks 045, 046".

(verb string, tasks []*model.Task)

Source from the content-addressed store, hash-verified

267
268// changeSegment returns a string like "complete task 042" or "add tasks 045, 046".
269func 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).

Callers 2

buildMixedCommitMessageFunction · 0.85
TestChangeSegmentFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestChangeSegmentFunction · 0.68