| 444 | } |
| 445 | |
| 446 | func showLightweightDiffVsMain(root string) { |
| 447 | cmd := exec.Command("git", "diff", "--name-only", "main...HEAD") |
| 448 | cmd.Dir = root |
| 449 | out, err := cmd.Output() |
| 450 | if err != nil { |
| 451 | fmt.Println(" (unable to read git diff)") |
| 452 | return |
| 453 | } |
| 454 | |
| 455 | lines := strings.Split(strings.TrimSpace(string(out)), "\n") |
| 456 | if len(lines) == 1 && lines[0] == "" { |
| 457 | fmt.Println(" No files changed") |
| 458 | return |
| 459 | } |
| 460 | |
| 461 | const maxShown = 20 |
| 462 | for i, line := range lines { |
| 463 | if i >= maxShown { |
| 464 | fmt.Printf(" ... and %d more files\n", len(lines)-maxShown) |
| 465 | break |
| 466 | } |
| 467 | fmt.Printf(" • %s\n", line) |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | // getLastSessionEvents reads events.log for previous session context |
| 472 | func getLastSessionEvents(root string) []string { |