From 2159d77f368eb1f78e51dd94133554f88052d85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 11 Oct 2018 11:05:30 +0200 Subject: [PATCH 1/6] common/collections: Fix type checking in Append The fix introduced in Hugo `0.49.1` had an unintended side-effect in the `Append` func used in both `append` and `.Scratch.Add`. This commit fixes that by loosen/fixing the type checking so concrete types can be appended to interface slices. Fixes #5303 --- common/collections/append.go | 2 +- common/collections/append_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/collections/append.go b/common/collections/append.go index e1008843b..97bf84988 100644 --- a/common/collections/append.go +++ b/common/collections/append.go @@ -59,7 +59,7 @@ func Append(to interface{}, from ...interface{}) (interface{}, error) { for _, f := range from { fv := reflect.ValueOf(f) - if tot != fv.Type() { + if !fv.Type().AssignableTo(tot) { return nil, fmt.Errorf("append element type mismatch: expected %v, got %v", tot, fv.Type()) } tov = reflect.Append(tov, fv) diff --git a/common/collections/append_test.go b/common/collections/append_test.go index e3361fb26..f89ec60f0 100644 --- a/common/collections/append_test.go +++ b/common/collections/append_test.go @@ -43,7 +43,13 @@ func TestAppend(t *testing.T) { tstSlicers{&tstSlicer{"a"}, &tstSlicer{"b"}, &tstSlicer{"c"}}}, + {testSlicerInterfaces{&tstSlicerIn1{"a"}, &tstSlicerIn1{"b"}}, + []interface{}{&tstSlicerIn1{"c"}}, + testSlicerInterfaces{&tstSlicerIn1{"a"}, &tstSlicerIn1{"b"}, &tstSlicerIn1{"c"}}}, // Errors + {testSlicerInterfaces{&tstSlicerIn1{"a"}, &tstSlicerIn1{"b"}}, + []interface{}{"c"}, + false}, {"", []interface{}{[]string{"a", "b"}}, false}, // No string concatenation. {"ab", From b9e18e20c8535371ef1d9f1e2bfa057ac5d4b69b Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 11 Oct 2018 09:39:29 +0000 Subject: [PATCH 2/6] releaser: Add release notes draft for 0.49.2 Rename to *-ready.md to continue. [ci skip] --- temp/0.49.2-relnotes.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 temp/0.49.2-relnotes.md diff --git a/temp/0.49.2-relnotes.md b/temp/0.49.2-relnotes.md new file mode 100644 index 000000000..3807295b6 --- /dev/null +++ b/temp/0.49.2-relnotes.md @@ -0,0 +1,23 @@ + + +This is a bug-fix release with one important fix. + + +Hugo now has: + +* 29421+ [stars](https://github.com/gohugoio/hugo/stargazers) +* 440+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) +* 268+ [themes](http://themes.gohugo.io/) + +## Enhancements + +## Fixes + +### Other + +* Fix type checking in Append [2159d77f](https://github.com/gohugoio/hugo/commit/2159d77f368eb1f78e51dd94133554f88052d85f) [@bep](https://github.com/bep) [#5303](https://github.com/gohugoio/hugo/issues/5303) + + + + + From c397f2c08087cf4cda3abe2d146e30f58d6d3216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 11 Oct 2018 11:41:46 +0200 Subject: [PATCH 3/6] Release 0.49.2 --- temp/0.49.2-relnotes-ready.md | 10 ++++++++++ temp/0.49.2-relnotes.md | 23 ----------------------- 2 files changed, 10 insertions(+), 23 deletions(-) create mode 100644 temp/0.49.2-relnotes-ready.md delete mode 100644 temp/0.49.2-relnotes.md diff --git a/temp/0.49.2-relnotes-ready.md b/temp/0.49.2-relnotes-ready.md new file mode 100644 index 000000000..367baaf93 --- /dev/null +++ b/temp/0.49.2-relnotes-ready.md @@ -0,0 +1,10 @@ + + +This is fixes one regression from Hugo `0.42.1`: + +* Fix type checking in Append [2159d77f](https://github.com/gohugoio/hugo/commit/2159d77f368eb1f78e51dd94133554f88052d85f) [@bep](https://github.com/bep) [#5303](https://github.com/gohugoio/hugo/issues/5303) + + + + + diff --git a/temp/0.49.2-relnotes.md b/temp/0.49.2-relnotes.md deleted file mode 100644 index 3807295b6..000000000 --- a/temp/0.49.2-relnotes.md +++ /dev/null @@ -1,23 +0,0 @@ - - -This is a bug-fix release with one important fix. - - -Hugo now has: - -* 29421+ [stars](https://github.com/gohugoio/hugo/stargazers) -* 440+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors) -* 268+ [themes](http://themes.gohugo.io/) - -## Enhancements - -## Fixes - -### Other - -* Fix type checking in Append [2159d77f](https://github.com/gohugoio/hugo/commit/2159d77f368eb1f78e51dd94133554f88052d85f) [@bep](https://github.com/bep) [#5303](https://github.com/gohugoio/hugo/issues/5303) - - - - - From ad60948c4661868f8e0877f60a1aee6dbdf0fe11 Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 11 Oct 2018 09:47:57 +0000 Subject: [PATCH 4/6] releaser: Bump versions for release of 0.49.2 [ci skip] --- docs/config.toml | 2 +- helpers/hugo.go | 2 +- snapcraft.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/config.toml b/docs/config.toml index f54bc7f92..871dcb24f 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -69,7 +69,7 @@ twitter = "GoHugoIO" [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.49.1" + release = "0.49.2" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash) diff --git a/helpers/hugo.go b/helpers/hugo.go index d54e049c7..2a5f65596 100644 --- a/helpers/hugo.go +++ b/helpers/hugo.go @@ -126,7 +126,7 @@ func (v HugoVersion) NextPatchLevel(level int) HugoVersion { // This should be the only one. var CurrentHugoVersion = HugoVersion{ Number: 0.49, - PatchLevel: 1, + PatchLevel: 2, Suffix: "", } diff --git a/snapcraft.yaml b/snapcraft.yaml index 63a7e8652..f5e61de9a 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1,5 +1,5 @@ name: hugo -version: "0.49.1" +version: "0.49.2" summary: Fast and Flexible Static Site Generator description: | Hugo is a static HTML and CSS website generator written in Go. It is From 42cde666638dcdddc9125ac3acf9a6817aa3ba5f Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 11 Oct 2018 09:47:57 +0000 Subject: [PATCH 5/6] releaser: Add release notes to /docs for release of 0.49.2 [ci skip] --- docs/content/en/news/0.49.2-relnotes/index.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docs/content/en/news/0.49.2-relnotes/index.md diff --git a/docs/content/en/news/0.49.2-relnotes/index.md b/docs/content/en/news/0.49.2-relnotes/index.md new file mode 100644 index 000000000..a4bfc979c --- /dev/null +++ b/docs/content/en/news/0.49.2-relnotes/index.md @@ -0,0 +1,21 @@ + +--- +date: 2018-10-11 +title: "0.49.2" +description: "0.49.2" +categories: ["Releases"] +images: +- images/blog/hugo-bug-poster.png + +--- + + + +This is fixes one regression from Hugo `0.42.1`: + +* Fix type checking in Append [2159d77f](https://github.com/gohugoio/hugo/commit/2159d77f368eb1f78e51dd94133554f88052d85f) [@bep](https://github.com/bep) [#5303](https://github.com/gohugoio/hugo/issues/5303) + + + + + From b09e495a71add081760703dec00f1cf4bd717be5 Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Thu, 11 Oct 2018 09:49:59 +0000 Subject: [PATCH 6/6] releaser: Prepare repository for 0.50-DEV [ci skip] --- docs/config.toml | 2 +- helpers/hugo.go | 6 +++--- snapcraft.yaml | 4 ++-- temp/0.49.2-relnotes-ready.md | 10 ---------- 4 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 temp/0.49.2-relnotes-ready.md diff --git a/docs/config.toml b/docs/config.toml index 871dcb24f..054ccab56 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -69,7 +69,7 @@ twitter = "GoHugoIO" [params] description = "The world’s fastest framework for building websites" ## Used for views in rendered HTML (i.e., rather than using the .Hugo variable) - release = "0.49.2" + release = "0.50-DEV" ## Setting this to true will add a "noindex" to *EVERY* page on the site removefromexternalsearch = false ## Gh repo for site footer (include trailing slash) diff --git a/helpers/hugo.go b/helpers/hugo.go index 2a5f65596..b3ded9d5d 100644 --- a/helpers/hugo.go +++ b/helpers/hugo.go @@ -125,9 +125,9 @@ func (v HugoVersion) NextPatchLevel(level int) HugoVersion { // CurrentHugoVersion represents the current build version. // This should be the only one. var CurrentHugoVersion = HugoVersion{ - Number: 0.49, - PatchLevel: 2, - Suffix: "", + Number: 0.50, + PatchLevel: 0, + Suffix: "-DEV", } func hugoVersion(version float32, patchVersion int, suffix string) string { diff --git a/snapcraft.yaml b/snapcraft.yaml index f5e61de9a..64493c5cd 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1,12 +1,12 @@ name: hugo -version: "0.49.2" +version: "0.50-DEV" summary: Fast and Flexible Static Site Generator description: | Hugo is a static HTML and CSS website generator written in Go. It is optimized for speed, easy use and configurability. Hugo takes a directory with content and templates and renders them into a full HTML website. confinement: strict -grade: stable # "devel" or "stable" +grade: devel # "devel" or "stable" environment: GO111MODULE: on diff --git a/temp/0.49.2-relnotes-ready.md b/temp/0.49.2-relnotes-ready.md deleted file mode 100644 index 367baaf93..000000000 --- a/temp/0.49.2-relnotes-ready.md +++ /dev/null @@ -1,10 +0,0 @@ - - -This is fixes one regression from Hugo `0.42.1`: - -* Fix type checking in Append [2159d77f](https://github.com/gohugoio/hugo/commit/2159d77f368eb1f78e51dd94133554f88052d85f) [@bep](https://github.com/bep) [#5303](https://github.com/gohugoio/hugo/issues/5303) - - - - -