From 324b7fc5eb514f1e4f7e5087abf17fb0fa81b6e1 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sun, 29 Apr 2018 02:31:01 +0200 Subject: [PATCH 01/15] Add mergeMethod option to API config. --- src/backends/github/API.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backends/github/API.js b/src/backends/github/API.js index 459524ddbb49..8566e2c8f5bf 100644 --- a/src/backends/github/API.js +++ b/src/backends/github/API.js @@ -15,6 +15,7 @@ export default class API { this.branch = config.branch || "master"; this.repo = config.repo || ""; this.repoURL = `/repos/${ this.repo }`; + this.mergeMethod = config.mergeMethod || "merge"; } user() { From a25056be0f8f98a34feb8ae0681025d3249fca51 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sun, 29 Apr 2018 02:34:33 +0200 Subject: [PATCH 02/15] Use snake case for merge_method key --- src/backends/github/API.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/github/API.js b/src/backends/github/API.js index 8566e2c8f5bf..9befa2f30014 100644 --- a/src/backends/github/API.js +++ b/src/backends/github/API.js @@ -15,7 +15,7 @@ export default class API { this.branch = config.branch || "master"; this.repo = config.repo || ""; this.repoURL = `/repos/${ this.repo }`; - this.mergeMethod = config.mergeMethod || "merge"; + this.merge_method = config.merge_method || "merge"; } user() { From 0a3942232fc3f978e9def611df0580e7e4a2f450 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sun, 29 Apr 2018 02:39:58 +0200 Subject: [PATCH 03/15] Add merge_method to mergePR() request --- src/backends/github/API.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backends/github/API.js b/src/backends/github/API.js index 9befa2f30014..891ebb794484 100644 --- a/src/backends/github/API.js +++ b/src/backends/github/API.js @@ -636,6 +636,7 @@ export default class API { body: JSON.stringify({ commit_message: "Automatically generated. Merged on Netlify CMS.", sha: headSha, + merge_method: this.merge_method, }), }) .catch((error) => { From 12f409d8d497733c324b707442dbfe2ad8af6035 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sun, 29 Apr 2018 02:56:00 +0200 Subject: [PATCH 04/15] Get merge_method setting from backend config --- src/backends/github/implementation.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backends/github/implementation.js b/src/backends/github/implementation.js index 2663e15dd6f4..b820b1e9cf21 100644 --- a/src/backends/github/implementation.js +++ b/src/backends/github/implementation.js @@ -17,6 +17,7 @@ export default class GitHub { this.branch = config.getIn(["backend", "branch"], "master").trim(); this.api_root = config.getIn(["backend", "api_root"], "https://api.github.com"); this.token = ''; + this.merge_method = config.getIn(["backend", "merge_method"], "merge"); } authComponent() { From 7dcb7e94bfac2e00d4104d3dd658e0dfd818dff1 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sun, 29 Apr 2018 03:10:09 +0200 Subject: [PATCH 05/15] Document merge_method backend option --- website/site/content/docs/authentication-backends.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/site/content/docs/authentication-backends.md b/website/site/content/docs/authentication-backends.md index 6f0a44a45507..8c9f6834d648 100644 --- a/website/site/content/docs/authentication-backends.md +++ b/website/site/content/docs/authentication-backends.md @@ -95,3 +95,4 @@ be nested under that field. | `site_domain` | `location.hostname` (or `cms.netlify.com` when on `localhost`) | Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly. | | `base_url` | `https://api.netlify.com` | OAuth client URL for the `github` backend. **Required** when using an external OAuth server with the `github` backend. | | `auth_endpoint` | `auth` | Path to append to `base_url` for authentication requests. Optional. | +| `merge_method` | `merge` | Controls how pull requests are merged when using the Editorial Workflow. Possible values are `merge`, `squash` or `rebase`. Optional. | From 0598c72c25316489bd904c3aa7a597d8b40b64f8 Mon Sep 17 00:00:00 2001 From: delucis Date: Sun, 29 Apr 2018 10:58:19 +0200 Subject: [PATCH 06/15] Update contributor details. --- .all-contributorsrc | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 529b1271c8ac..a5ff635777eb 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -672,7 +672,8 @@ "avatar_url": "https://avatars2.githubusercontent.com/u/357379?v=4", "profile": "http://chrisswithinbank.net/", "contributions": [ - "doc" + "doc", + "code" ] }, { diff --git a/README.md b/README.md index 20a6e7783e09..0885b5d41f4a 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ These wonderful folks are responsible for developing and maintaining Netlify CMS | [
Etienne Bernard](https://github.com/ebernard)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=ebernard "Documentation") | [
Eli Williamson](http://eliwilliamson.com)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=eliwilliamson "Code") [๐ŸŽจ](#design-eliwilliamson "Design") | [
Covington Doan](https://www.covingtondoan.com)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=covingtondoan "Documentation") | [
Lennart Ziburski](http://lennartziburski.com)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=ziburski "Code") [๐ŸŽจ](#design-ziburski "Design") [๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=ziburski "Documentation") | [
Darrel O'Pry](http://darrelopry.com)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=dopry "Code") [๐Ÿš‡](#infra-dopry "Infrastructure (Hosting, Build-Tools, etc)") [โš ๏ธ](https://github.com/netlify/netlify-cms/commits?author=dopry "Tests") | [
Erin Symons](https://github.com/yourfrienderin)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=yourfrienderin "Documentation") | [
Austin Green](https://github.com/AustinGreen)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=AustinGreen "Documentation") [๐Ÿ’ก](#example-AustinGreen "Examples") | | [
Bryan Robinson](http://bryanlrobinson.com)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=brob "Documentation") | [
Darren](https://github.com/dardub)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=dardub "Documentation") | [
Richard Pullinger](http://www.richardpullinger.com)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=rpullinger "Code") | [
Taylor Bryant](https://taylorbryant.blog)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=taylorbryant "Documentation") | [
kvanerkelens](https://github.com/kvanerkelens)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=kvanerkelens "Documentation") | [
Patrick Sier](https://patsier.com/)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=pjsier "Code") | [
Christian Nolte](http://noltech.net)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=drlogout "Code") | | [
Edward Betts](http://edwardbetts.com/)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=EdwardBetts "Documentation") | [
Josh Hardman](https://github.com/jhardman0830)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=jhardman0830 "Documentation") | [
Mantas](https://behance.net/mistermantas)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=mistermantas "Documentation") | [
Marco Biedermann](https://www.marcobiedermann.com)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=marcobiedermann "Documentation") | [
Max Stoiber](https://mxstbr.blog/newsletter)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=mxstbr "Documentation") | [
Vyacheslav Matyukhin](http://berekuk.ru)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=berekuk "Documentation") | [
jimmaaay](https://jimmythompson.me)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=jimmaaay "Code") | -| [
Luรญs Miguel](https://github.com/Quicksaver)
[๐Ÿ›](https://github.com/netlify/netlify-cms/issues?q=author%3AQuicksaver "Bug reports") [๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=Quicksaver "Code") | [
Chris Swithinbank](http://chrisswithinbank.net/)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=delucis "Documentation") | [
remmah](https://github.com/remmah)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=remmah "Documentation") | [
Sumeet Jain](http://sumeetjain.com)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=sumeetjain "Documentation") | [
Sagar Khatri](https://github.com/ragasirtahk)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=ragasirtahk "Documentation") [๐Ÿ’ก](#example-ragasirtahk "Examples") | [
Kevin Doocey](https://www.dooceykev.in)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=Doocey "Code") | [
Swieckowski](https://www.linkedin.com/in/arthur-swieckowski/)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Code") [๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Documentation") [โš ๏ธ](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Tests") | +| [
Luรญs Miguel](https://github.com/Quicksaver)
[๐Ÿ›](https://github.com/netlify/netlify-cms/issues?q=author%3AQuicksaver "Bug reports") [๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=Quicksaver "Code") | [
Chris Swithinbank](http://chrisswithinbank.net/)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=delucis "Documentation") [๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=delucis "Code") | [
remmah](https://github.com/remmah)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=remmah "Documentation") | [
Sumeet Jain](http://sumeetjain.com)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=sumeetjain "Documentation") | [
Sagar Khatri](https://github.com/ragasirtahk)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=ragasirtahk "Documentation") [๐Ÿ’ก](#example-ragasirtahk "Examples") | [
Kevin Doocey](https://www.dooceykev.in)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=Doocey "Code") | [
Swieckowski](https://www.linkedin.com/in/arthur-swieckowski/)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Code") [๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Documentation") [โš ๏ธ](https://github.com/netlify/netlify-cms/commits?author=Swieckowski "Tests") | | [
Tim Carry](http://www.pixelastic.com/)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Code") [๐ŸŽจ](#design-pixelastic "Design") [๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Documentation") | [
Sol Park](https://github.com/solpark)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=solpark "Code") | [
Michael Romani](https://github.com/MichaelRomani)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=MichaelRomani "Code") | [
Xifeng Jin](http://linkedin/in/xifengjin88)
[๐Ÿ›](https://github.com/netlify/netlify-cms/issues?q=author%3Axifengjin88 "Bug reports") [๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=xifengjin88 "Code") | [
Pedro Duarte](http://pedroduarte.me)
[๐Ÿ›](https://github.com/netlify/netlify-cms/issues?q=author%3Apeduarte "Bug reports") [๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=peduarte "Code") [๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=peduarte "Documentation") | [
Antonio Argote](http://antonioargote.com)
[๐ŸŽจ](#design-Strangehill "Design") | [
Kristaps Taube](https://www.ktaube.com)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=ktaube "Code") | | [
David Ko](https://github.com/daveyko)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=daveyko "Code") | [
Iรฑaki Garcรญa](http://www.txorua.com)
[๐ŸŽจ](#design-igarbla "Design") | [
Sam](https://github.com/gazebosx3)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=gazebosx3 "Code") | [
Josh Dzielak](https://dzello.com)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=dzello "Documentation") | [
Jeremy Bise](http://thosegeeks.com)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=jeremybise "Documentation") | [
terrierscript](https://terrierscript.com)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=terrierscript "Code") | [
Christopher Geary](https://twitter.com/crgeary)
[๐Ÿ”Œ](#plugin-crgeary "Plugin/utility libraries") | | [
Brian Macdonald](https://github.com/brianlmacdonald)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=brianlmacdonald "Code") | [
John Vandenberg](https://jayvdb.github.io/)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=jayvdb "Documentation") | [
MarkZither](https://github.com/MarkZither)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=MarkZither "Documentation") | [
Rob Phoenix](https://www.robphoenix.com)
[๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=robphoenix "Documentation") | [
Steve Lathrop](https://www.SteLa.io)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=slathrop "Code") [๐Ÿ“–](https://github.com/netlify/netlify-cms/commits?author=slathrop "Documentation") [๐Ÿ’ก](#example-slathrop "Examples") | [
Maciej Matuszewski](https://github.com/maciejmatu)
[๐Ÿ’ป](https://github.com/netlify/netlify-cms/commits?author=maciejmatu "Code") | From db2759083a3563b1b4693ec58d68bcc33f27e343 Mon Sep 17 00:00:00 2001 From: delucis Date: Sun, 29 Apr 2018 17:07:33 +0200 Subject: [PATCH 07/15] Switch to boolean squash or standard merge config. --- src/backends/github/API.js | 2 +- src/backends/github/implementation.js | 2 +- website/site/content/docs/authentication-backends.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backends/github/API.js b/src/backends/github/API.js index 891ebb794484..783bb04171ac 100644 --- a/src/backends/github/API.js +++ b/src/backends/github/API.js @@ -15,7 +15,7 @@ export default class API { this.branch = config.branch || "master"; this.repo = config.repo || ""; this.repoURL = `/repos/${ this.repo }`; - this.merge_method = config.merge_method || "merge"; + this.merge_method = config.squash_merges ? "squash" : "merge"; } user() { diff --git a/src/backends/github/implementation.js b/src/backends/github/implementation.js index b820b1e9cf21..476dc739f72c 100644 --- a/src/backends/github/implementation.js +++ b/src/backends/github/implementation.js @@ -17,7 +17,7 @@ export default class GitHub { this.branch = config.getIn(["backend", "branch"], "master").trim(); this.api_root = config.getIn(["backend", "api_root"], "https://api.github.com"); this.token = ''; - this.merge_method = config.getIn(["backend", "merge_method"], "merge"); + this.squash_merges = config.getIn(["backend", "squash_merges"]); } authComponent() { diff --git a/website/site/content/docs/authentication-backends.md b/website/site/content/docs/authentication-backends.md index 8c9f6834d648..db8922c523da 100644 --- a/website/site/content/docs/authentication-backends.md +++ b/website/site/content/docs/authentication-backends.md @@ -95,4 +95,4 @@ be nested under that field. | `site_domain` | `location.hostname` (or `cms.netlify.com` when on `localhost`) | Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly. | | `base_url` | `https://api.netlify.com` | OAuth client URL for the `github` backend. **Required** when using an external OAuth server with the `github` backend. | | `auth_endpoint` | `auth` | Path to append to `base_url` for authentication requests. Optional. | -| `merge_method` | `merge` | Controls how pull requests are merged when using the Editorial Workflow. Possible values are `merge`, `squash` or `rebase`. Optional. | +| `squash_merges` | `false` | If true, squash merges pull requests using when using the Editorial Workflow. Optional. | From 93d20ccb6cba0f49142389ad1821be16a445860d Mon Sep 17 00:00:00 2001 From: delucis Date: Sun, 29 Apr 2018 18:59:32 +0200 Subject: [PATCH 08/15] Add config validation for backend.squash_merges option. --- src/actions/config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/actions/config.js b/src/actions/config.js index c290b4fe67ff..d87280a70707 100644 --- a/src/actions/config.js +++ b/src/actions/config.js @@ -50,6 +50,9 @@ export function validateConfig(config) { if (typeof config.getIn(['backend', 'name']) !== 'string') { throw new Error("Error in configuration file: Your `backend.name` must be a string. Check your config.yml file."); } + if (!isBoolean(config.getIn(['backend', 'squash_merges'], false))) { + throw new Error("Error in configuration file: Your `backend.squash_merges` must be a boolean. Check your config.yml file."); + } if (!config.get('media_folder')) { throw new Error("Error in configuration file: A `media_folder` wasn\'t found. Check your config.yml file."); } From 94ed8583fa7bb2e3a2970d14c2900b3d9e8615b0 Mon Sep 17 00:00:00 2001 From: delucis Date: Sun, 29 Apr 2018 20:01:11 +0200 Subject: [PATCH 09/15] Pass squash_merges option to `new API()` calls. --- src/backends/git-gateway/implementation.js | 1 + src/backends/github/implementation.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backends/git-gateway/implementation.js b/src/backends/git-gateway/implementation.js index 447c5324d570..fe9b8ea0b6b0 100644 --- a/src/backends/git-gateway/implementation.js +++ b/src/backends/git-gateway/implementation.js @@ -70,6 +70,7 @@ export default class GitGateway extends GitHubBackend { branch: this.branch, tokenPromise: this.tokenPromise, commitAuthor: pick(userData, ["name", "email"]), + squash_merges: this.squash_merges, }); return userData; } else { diff --git a/src/backends/github/implementation.js b/src/backends/github/implementation.js index 476dc739f72c..2fa63f4b72aa 100644 --- a/src/backends/github/implementation.js +++ b/src/backends/github/implementation.js @@ -30,7 +30,7 @@ export default class GitHub { authenticate(state) { this.token = state.token; - this.api = new API({ token: this.token, branch: this.branch, repo: this.repo, api_root: this.api_root }); + this.api = new API({ token: this.token, branch: this.branch, repo: this.repo, api_root: this.api_root, squash_merges: this.squash_merges }); return this.api.user().then(user => this.api.hasWriteAccess().then((isCollab) => { // Unauthorized user From c6ab1768153fe53805b2afe32243538e35472e7a Mon Sep 17 00:00:00 2001 From: delucis Date: Sun, 29 Apr 2018 20:05:43 +0200 Subject: [PATCH 10/15] Improve explanation in docs. --- website/site/content/docs/authentication-backends.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/site/content/docs/authentication-backends.md b/website/site/content/docs/authentication-backends.md index db8922c523da..d17c70886aba 100644 --- a/website/site/content/docs/authentication-backends.md +++ b/website/site/content/docs/authentication-backends.md @@ -95,4 +95,4 @@ be nested under that field. | `site_domain` | `location.hostname` (or `cms.netlify.com` when on `localhost`) | Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly. | | `base_url` | `https://api.netlify.com` | OAuth client URL for the `github` backend. **Required** when using an external OAuth server with the `github` backend. | | `auth_endpoint` | `auth` | Path to append to `base_url` for authentication requests. Optional. | -| `squash_merges` | `false` | If true, squash merges pull requests using when using the Editorial Workflow. Optional. | +| `squash_merges` | `false` | If true, pull requests are merged using the โ€œsquash and mergeโ€ method, reducing clutter in the content repository. Optional. | From 94964b8ea1c9e7abcd763afc022f931c524b04aa Mon Sep 17 00:00:00 2001 From: delucis Date: Sun, 29 Apr 2018 20:08:04 +0200 Subject: [PATCH 11/15] Improve explanation in docs. --- website/site/content/docs/authentication-backends.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/site/content/docs/authentication-backends.md b/website/site/content/docs/authentication-backends.md index d17c70886aba..2fa10dcd3048 100644 --- a/website/site/content/docs/authentication-backends.md +++ b/website/site/content/docs/authentication-backends.md @@ -95,4 +95,4 @@ be nested under that field. | `site_domain` | `location.hostname` (or `cms.netlify.com` when on `localhost`) | Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly. | | `base_url` | `https://api.netlify.com` | OAuth client URL for the `github` backend. **Required** when using an external OAuth server with the `github` backend. | | `auth_endpoint` | `auth` | Path to append to `base_url` for authentication requests. Optional. | -| `squash_merges` | `false` | If true, pull requests are merged using the โ€œsquash and mergeโ€ method, reducing clutter in the content repository. Optional. | +| `squash_merges` | `false` | If `true`, pull requests are merged using the โ€œsquash and mergeโ€ method, reducing clutter in the content repositoryโ€™s commit history. Optional. | From e8bc69c8c59d7e070509006fa5d2369e45b33350 Mon Sep 17 00:00:00 2001 From: delucis Date: Thu, 3 May 2018 11:32:05 +0200 Subject: [PATCH 12/15] Move squash_merges documentation to Beta Features page. --- website/site/content/docs/authentication-backends.md | 1 - website/site/content/docs/beta-features.md | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/website/site/content/docs/authentication-backends.md b/website/site/content/docs/authentication-backends.md index 2fa10dcd3048..6f0a44a45507 100644 --- a/website/site/content/docs/authentication-backends.md +++ b/website/site/content/docs/authentication-backends.md @@ -95,4 +95,3 @@ be nested under that field. | `site_domain` | `location.hostname` (or `cms.netlify.com` when on `localhost`) | Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly. | | `base_url` | `https://api.netlify.com` | OAuth client URL for the `github` backend. **Required** when using an external OAuth server with the `github` backend. | | `auth_endpoint` | `auth` | Path to append to `base_url` for authentication requests. Optional. | -| `squash_merges` | `false` | If `true`, pull requests are merged using the โ€œsquash and mergeโ€ method, reducing clutter in the content repositoryโ€™s commit history. Optional. | diff --git a/website/site/content/docs/beta-features.md b/website/site/content/docs/beta-features.md index 47e6fada3466..ebfb4d0ef150 100644 --- a/website/site/content/docs/beta-features.md +++ b/website/site/content/docs/beta-features.md @@ -77,3 +77,10 @@ import styles from '!css-loader!sass-loader!../main.scss' CMS.registerPreviewStyle(styles.toString(), { raw: true }) ``` +## Squash merge GitHub pull requests +When using the [Editorial Workflow publish mode](/docs/configuration-options/#publish-mode) with the `github` or `git-gateway` backends, Netlify CMS creates pull requests to hold drafts while they are being edited and then merges them into your main branch when you press publish. By default, these are merged preserving the history of all the individual commits (i.e. changes where you pressed save). If instead you would like [โ€œsquashโ€](https://help.github.com/articles/about-pull-request-merges/#squash-and-merge-your-pull-request-commits) these commits, reducing clutter in your repositoryโ€™s history, you can set the following option in your `config.yml`: + +```yaml +backend: + squash_merges: true +``` From 1e379e9556eacf74e37d6eb1c45722c40384f9e1 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Sat, 5 May 2018 06:39:44 +0200 Subject: [PATCH 13/15] Simplify documentation language for clarity. --- website/site/content/docs/beta-features.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/site/content/docs/beta-features.md b/website/site/content/docs/beta-features.md index ebfb4d0ef150..10c4cfafb0d6 100644 --- a/website/site/content/docs/beta-features.md +++ b/website/site/content/docs/beta-features.md @@ -78,7 +78,9 @@ CMS.registerPreviewStyle(styles.toString(), { raw: true }) ``` ## Squash merge GitHub pull requests -When using the [Editorial Workflow publish mode](/docs/configuration-options/#publish-mode) with the `github` or `git-gateway` backends, Netlify CMS creates pull requests to hold drafts while they are being edited and then merges them into your main branch when you press publish. By default, these are merged preserving the history of all the individual commits (i.e. changes where you pressed save). If instead you would like [โ€œsquashโ€](https://help.github.com/articles/about-pull-request-merges/#squash-and-merge-your-pull-request-commits) these commits, reducing clutter in your repositoryโ€™s history, you can set the following option in your `config.yml`: +When using the [Editorial Workflow publish mode](/docs/configuration-options/#publish-mode) with the `github` or `git-gateway` backends, Netlify CMS creates pull requests to hold drafts while they are being edited and then merges them into your main branch when you press publish. By default, these are merged preserving the history of all the individual commits. In other words, you will have a commit in your history for every time you pressed the save button. + +If instead you would like to [โ€œsquashโ€](https://help.github.com/articles/about-pull-request-merges/#squash-and-merge-your-pull-request-commits) these commits into a single commit, reducing clutter in your repositoryโ€™s history, you can set the following option in your `config.yml`: ```yaml backend: From 48c1b2f99eef8ac4dabcd197a7e18dc5e9231d99 Mon Sep 17 00:00:00 2001 From: delucis Date: Sat, 12 May 2018 19:00:41 +0200 Subject: [PATCH 14/15] Remove config validation. This reverts commit 93d20ccb6cba0f49142389ad1821be16a445860d. --- src/actions/config.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/actions/config.js b/src/actions/config.js index d87280a70707..c290b4fe67ff 100644 --- a/src/actions/config.js +++ b/src/actions/config.js @@ -50,9 +50,6 @@ export function validateConfig(config) { if (typeof config.getIn(['backend', 'name']) !== 'string') { throw new Error("Error in configuration file: Your `backend.name` must be a string. Check your config.yml file."); } - if (!isBoolean(config.getIn(['backend', 'squash_merges'], false))) { - throw new Error("Error in configuration file: Your `backend.squash_merges` must be a boolean. Check your config.yml file."); - } if (!config.get('media_folder')) { throw new Error("Error in configuration file: A `media_folder` wasn\'t found. Check your config.yml file."); } From b644032b541878edfd7118fed8f9716ce5dc3be3 Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Mon, 14 May 2018 10:47:46 -0400 Subject: [PATCH 15/15] update docs --- website/site/content/docs/beta-features.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/site/content/docs/beta-features.md b/website/site/content/docs/beta-features.md index 10c4cfafb0d6..e0ed55b9bb2b 100644 --- a/website/site/content/docs/beta-features.md +++ b/website/site/content/docs/beta-features.md @@ -78,9 +78,11 @@ CMS.registerPreviewStyle(styles.toString(), { raw: true }) ``` ## Squash merge GitHub pull requests -When using the [Editorial Workflow publish mode](/docs/configuration-options/#publish-mode) with the `github` or `git-gateway` backends, Netlify CMS creates pull requests to hold drafts while they are being edited and then merges them into your main branch when you press publish. By default, these are merged preserving the history of all the individual commits. In other words, you will have a commit in your history for every time you pressed the save button. +When using the [Editorial Workflow](/docs/configuration-options/#publish-mode) with the `github` or `git-gateway` backends, Netlify CMS creates a pull request for each unpublished entry. Every time the unpublished entry is changed and saved, a new commit is added to the pull request. When the entry is published, the pull request is merged, and all of those commits are added to your project commit history in a merge commit. -If instead you would like to [โ€œsquashโ€](https://help.github.com/articles/about-pull-request-merges/#squash-and-merge-your-pull-request-commits) these commits into a single commit, reducing clutter in your repositoryโ€™s history, you can set the following option in your `config.yml`: +The squash merge option causes all commits to be "squashed" into a single commit when the pull request is merged, and the resulting commit is rebased onto the target branch, avoiding the merge commit altogether. + +To enable this feature, you can set the following option in your `config.yml`: ```yaml backend: