MCPcopy Create free account
hub / github.com/JordanCoin/codemap / showLightweightDiffVsMain

Function showLightweightDiffVsMain

cmd/hooks.go:446–469  ·  view source on GitHub ↗
(root string)

Source from the content-addressed store, hash-verified

444}
445
446func 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
472func getLastSessionEvents(root string) []string {

Callers 1

showDiffVsMainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected