GitLab - Squash n' Merge

Defaults to squash commits and remove source branches on merge

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        GitLab - Squash n' Merge
// @description Defaults to squash commits and remove source branches on merge
// @author      Sam McLeod | https://twitter.com/s_mcleod | https://smcleod.net
// @include     /^https?://gitlab.*/.*/.*/merge_requests/new*
// @icon         https://gitlab.com/assets/gitlab_logo-7ae504fe4f68fdebb3c2034e36621930cd36ea87924c11ff65dbcb8ed50dca58.png
// @license MIT
// @version 1.0.1
// check remove-source-branch-input checkbox
// check merge-param-checkbox checkbox
//
// @namespace https://greasyfork.org/users/97169
// ==/UserScript==

// Check remove source branch
checkThem([].slice.call(document.querySelectorAll('input[type="checkbox"]' && 'input[id="merge_request_force_remove_source_branch"]')));

// Check squash merge request
checkThem([].slice.call(document.querySelectorAll('input[type="checkbox"]' && 'input[id="merge_request_squash"]')));

function checkThem(nodes) {
  nodes.forEach(function (n) {
    n.checked = true;
  });
}