Skip to content

Commit b35e365

Browse files
committed
update: improve informational printouts
Add and update informational printouts in 'git-bundle-server update' to inform users more accurately of which step is in progress, as well as clearly indicate when the update stops early due to a lack of updates from the remote. Also add a printout to 'update-all' indicating which route is being updated at a given time as it loops through all routes. Signed-off-by: Victoria Dye <[email protected]>
1 parent a8fdc7a commit b35e365

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cmd/git-bundle-server/update-all.go

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func (u *updateAllCmd) Run(ctx context.Context, args []string) error {
5656

5757
for route := range repos {
5858
subargs[1] = route
59+
fmt.Printf("*** Updating %s ***\n", route)
5960
exitCode, err := commandExecutor.RunStdout(ctx, exe, subargs...)
6061
if err != nil {
6162
return u.logger.Error(ctx, err)

cmd/git-bundle-server/update.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -52,30 +52,32 @@ func (u *updateCmd) Run(ctx context.Context, args []string) error {
5252
return u.logger.Errorf(ctx, "failed to load bundle list: %w", err)
5353
}
5454

55-
fmt.Printf("Creating new incremental bundle\n")
55+
fmt.Printf("Checking for updates to %s\n", repo.Route)
5656
bundle, err := bundleProvider.CreateIncrementalBundle(ctx, repo, list)
5757
if err != nil {
5858
return u.logger.Error(ctx, err)
5959
}
6060

6161
// Nothing new!
6262
if bundle == nil {
63+
fmt.Printf("%s is up-to-date, no new bundles generated\n", repo.Route)
6364
return nil
6465
}
6566

6667
list.Bundles[bundle.CreationToken] = *bundle
6768

68-
fmt.Printf("Collapsing bundle list\n")
69+
fmt.Println("Updating bundle list")
6970
err = bundleProvider.CollapseList(ctx, repo, list)
7071
if err != nil {
7172
return u.logger.Error(ctx, err)
7273
}
7374

74-
fmt.Printf("Writing updated bundle list\n")
75+
fmt.Println("Writing updated bundle list")
7576
listErr := bundleProvider.WriteBundleList(ctx, list, repo)
7677
if listErr != nil {
7778
return u.logger.Errorf(ctx, "failed to write bundle list: %w", listErr)
7879
}
7980

81+
fmt.Println("Update complete")
8082
return nil
8183
}

0 commit comments

Comments
 (0)