@@ -8,18 +8,25 @@ import (
88)
99
1010var logCmd = & cobra.Command {
11- Use : "log <env>" ,
12- Short : "View what an agent did step-by-step" ,
11+ Use : "log <env>" ,
12+ Short : "View what an agent did step-by-step" ,
1313 Long : `Display the complete development history for an environment.
1414Shows all commits made by the agent plus command execution notes.
15- Use -p to include code patches in the output.` ,
15+ Use -p to include code patches in the output.
16+ Use -b to compare against a specific branch instead of showing full history.` ,
1617 Args : cobra .ExactArgs (1 ),
1718 ValidArgsFunction : suggestEnvironments ,
18- Example : `# See what agent did
19+ Example : `# See what agent did (full history)
1920cu log fancy-mallard
2021
2122# Include code changes
22- cu log fancy-mallard -p` ,
23+ cu log fancy-mallard -p
24+
25+ # Compare against main branch
26+ cu log fancy-mallard -b main
27+
28+ # Compare against main with patches
29+ cu log fancy-mallard -b main -p` ,
2330 RunE : func (app * cobra.Command , args []string ) error {
2431 ctx := app .Context ()
2532
@@ -30,12 +37,14 @@ cu log fancy-mallard -p`,
3037 }
3138
3239 patch , _ := app .Flags ().GetBool ("patch" )
40+ branch , _ := app .Flags ().GetString ("branch" )
3341
34- return repo .Log (ctx , args [0 ], patch , os .Stdout )
42+ return repo .Log (ctx , args [0 ], patch , branch , os .Stdout )
3543 },
3644}
3745
3846func init () {
3947 logCmd .Flags ().BoolP ("patch" , "p" , false , "Generate patch" )
48+ logCmd .Flags ().StringP ("branch" , "b" , "" , "Compare against specified branch (uses merge-base)" )
4049 rootCmd .AddCommand (logCmd )
4150}
0 commit comments