Skip to content

Commit f98944a

Browse files
authored
fix(cli): better warning for failed background-update of local mirror (#401)
* fix(cli): improve warning about failure to background-update local mirrors * Also show better warning message in background update from downloading repo * Make `plt switch` keep going with local mirrors if there's no internet * Bump version for prerelease
1 parent b988886 commit f98944a

File tree

4 files changed

+170
-155
lines changed

4 files changed

+170
-155
lines changed

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ changelog:
9494
release:
9595
prerelease: auto
9696
footer: |
97-
**Full human-written changelog**: [`CHANGELOG.md`]({{ .GitURL }}/blob/main/CHANGELOG.md)
97+
**Full hand-crafted changelog**: [`CHANGELOG.md`]({{ .GitURL }}/blob/main/CHANGELOG.md)
9898
9999
{{ if and .Tag .PreviousTag }}
100100
**Commit History**: [{{ .Tag }}...{{ .PreviousTag }}]({{ .GitURL }}/compare/{{ .Tag }}...{{ .PreviousTag }})

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.8.0-beta.1 - 2025-03-19
9+
10+
### Fixed
11+
12+
- (cli) Improved warning messages printed when an optional background update of a local mirror of a Git repo fails (e.g. due to lack of internet access) to better reassure the user that it might not be a problem.
13+
- (cli) If `plt switch` is run without internet access, now instead of quitting immediately with an error (due to being unable to fetch changes from remotes) the subcommand will print a warning and continue until either the operation fails (because it couldn't determine that the current commit of the current pallet is in the cache's local mirror of the remote origin) or succeeds (because the commit is in the local mirror, or because `--force` was set).
14+
815
## 0.8.0-beta.0 - 2025-03-19
916

1017
### Added

cmd/forklift/plt/pallets.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,12 @@ func checkPalletDirtiness(workspace *forklift.FSWorkspace, force bool) error {
296296

297297
fmt.Fprintln(os.Stderr, "Fetching changes from the remote...")
298298
if err = gitRepo.FetchAll(1, os.Stdout); err != nil {
299-
return errors.Wrap(err, "couldn't fetch changes from the remote Git repo")
299+
fcli.IndentedFprintf(
300+
1, os.Stderr,
301+
"Warning: couldn't fetch changes (maybe you don't have internet, or maybe the repo doesn't "+
302+
"exist?): %s\n", err,
303+
)
304+
fcli.IndentedFprintln(1, os.Stderr, "We may be able to continue anyways, so we'll keep going!")
300305
}
301306

302307
fmt.Fprintf(

0 commit comments

Comments
 (0)