| 443 | } |
| 444 | |
| 445 | func (r *Repository) Log(ctx context.Context, id string, patch bool, w io.Writer) error { |
| 446 | envInfo, err := r.Info(ctx, id) |
| 447 | if err != nil { |
| 448 | return err |
| 449 | } |
| 450 | |
| 451 | logArgs := []string{ |
| 452 | "log", |
| 453 | fmt.Sprintf("--notes=%s", gitNotesLogRef), |
| 454 | } |
| 455 | |
| 456 | if patch { |
| 457 | logArgs = append(logArgs, "--patch") |
| 458 | } else { |
| 459 | logArgs = append(logArgs, "--format=%C(yellow)%h%Creset %s %Cgreen(%cr)%Creset %+N") |
| 460 | } |
| 461 | |
| 462 | revisionRange, err := r.revisionRange(ctx, envInfo) |
| 463 | if err != nil { |
| 464 | return err |
| 465 | } |
| 466 | |
| 467 | logArgs = append(logArgs, revisionRange) |
| 468 | |
| 469 | return RunInteractiveGitCommand(ctx, r.userRepoPath, w, logArgs...) |
| 470 | } |
| 471 | |
| 472 | func (r *Repository) Diff(ctx context.Context, id string, w io.Writer) error { |
| 473 | envInfo, err := r.Info(ctx, id) |