Remove PR details on squash&merge
hubertgrzeskowiak opened this issue · 5 comments
At my company we only use the squash & merge strategy. Each time you press the button, the commit form is pre-filled with all commit messages from the PR. This is redundant, since the PR contains all commits and it is linked anyways. What we do is selecting all the text in the textarea and remove it each time we merge a PR. This is tedious and sounds like something that could be automated using refined-github.
I've got this code, which is working for me through the dev tools console, but I could use some help in creating a real extension from this:
document.querySelector(".merge-message .btn-group-squash button")
.addEventListener("click", function() {
document.querySelector(".merge-branch-form .merge-commit-message").value = ""
}
);
I think best would be a Cookie-backed opt-in to disable the extended commit messages on PRs for a repository. I imagine a check-box that, once clicked, will completely remove the textarea.
I like this functionality as it mimics other tools for managing your workflow and code reviews. People who look at the squashed commit not on GitHub still benefit from that information.
Someone sent a similar solution (#1312) which, instead of simply clearing it, uses the first post's message.
@hkdobrev maybe I hang out in poor repos, but the commit list usually looks like this:
* Add hotkeys on Pull Request tabs
* Fix eslint errors
* Loop it up
* Further simplify selector
* Cycle through tabs
* Use .dataset
* Change hotkeys and fix broken cycle
* Add shortcut in help dialog & readme
* Fix linting
* Little fix
* Shorten readme description
* Use `g` key
Is it useful?
I'd say that if single commit information is useful, the PR should be merged with a merge commit, not squashed.