MCPcopy
hub / github.com/dagger/container-use / Log

Method Log

repository/repository.go:445–470  ·  view source on GitHub ↗
(ctx context.Context, id string, patch bool, w io.Writer)

Source from the content-addressed store, hash-verified

443}
444
445func (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
472func (r *Repository) Diff(ctx context.Context, id string, w io.Writer) error {
473 envInfo, err := r.Info(ctx, id)

Callers 3

TestRepositoryLogFunction · 0.80
log.goFile · 0.80
getContainerUseBinaryFunction · 0.80

Calls 3

InfoMethod · 0.95
revisionRangeMethod · 0.95
RunInteractiveGitCommandFunction · 0.85

Tested by 2

TestRepositoryLogFunction · 0.64
getContainerUseBinaryFunction · 0.64