aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-09-17 09:34:35 +0200
committerBjørn Erik Pedersen <[email protected]>2021-09-17 09:34:35 +0200
commit1cabf61ddf96b89c95c3ba77a985168184920feb (patch)
tree30f591b7541519174d74720c8c31cd5ac98be3c8 /modules
parent268e3069f37df01a5a58b615844652fb75b8503a (diff)
downloadhugo-1cabf61ddf96b89c95c3ba77a985168184920feb.tar.gz
hugo-1cabf61ddf96b89c95c3ba77a985168184920feb.zip
modules: Add some help text to the 'unknown revision' error
I had a head scratching moment with this myself, so it's safe to say that others will. See #6825
Diffstat (limited to 'modules')
-rw-r--r--modules/client.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/client.go b/modules/client.go
index 8d9bf8762..4a45c97ff 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -627,7 +627,14 @@ func (c *Client) runGo(
if strings.Contains(stderr.String(), "invalid version: unknown revision") {
// See https://github.com/gohugoio/hugo/issues/6825
- c.logger.Println(`hugo: you need to manually edit go.mod to resolve the unknown revision.`)
+ c.logger.Println(`An unknown resivion most likely means that someone has deleted the remote ref (e.g. with a force push to GitHub).
+To resolve this, you need to manually edit your go.mod file and replace the version for the module in question with a valid ref.
+
+The easiest is to just enter a valid branch name ther, e.g. master, which would be the what you put in place of 'v0.5.1' in the example below.
+
+require github.com/gohugoio/hugo-mod-jslibs/instantpage v0.5.1
+
+If you then run 'hugo mod graph' it should resolve itself to the most recent version (or commit if no semver versions).`)
}
_, ok := err.(*exec.ExitError)