Skip to content

Commit 744e99a

Browse files
xiaolingsindresorhus
authored andcommitted
Use the pull request description as the commit message when merging with Squash and merge (refined-github#1312)
1 parent 3d833fc commit 744e99a

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ GitHub Enterprise is also supported. More info in the options.
102102
- [View linked gists inline in comments.](https://user-images.githubusercontent.com/6978877/33911900-c62ee968-df8b-11e7-8685-506ffafc60b4.PNG)
103103
- [Search a user profile page when visiting it.](https://user-images.githubusercontent.com/1402241/35185441-24ad4b1e-fe37-11e7-9e1b-0dc09fc1ada2.png)
104104
- [Avoid opening duplicate issues thanks to the list of possibly-related issues.](https://user-images.githubusercontent.com/29176678/37566899-85953e6e-2abf-11e8-9f0e-52d18c87bbe3.gif)
105+
- [Use the pull request description as the commit message when merging with `Squash and merge`](https://github.com/sindresorhus/refined-github/issues/1322).
105106

106107
### More actions
107108

source/content.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import addMilestoneNavigation from './features/add-milestone-navigation';
4747
import addFilterCommentsByYou from './features/add-filter-comments-by-you';
4848
import removeProjectsTab from './features/remove-projects-tab';
4949
import fixSquashAndMergeTitle from './features/fix-squash-and-merge-title';
50+
import fixSquashAndMergeMessage from './features/fix-squash-and-merge-message';
5051
import addTitleToEmojis from './features/add-title-to-emojis';
5152
import sortMilestonesByClosestDueDate from './features/sort-milestones-by-closest-due-date';
5253
import openCIDetailsInNewTab from './features/open-ci-details-in-new-tab';
@@ -219,6 +220,7 @@ function ajaxedPagesHandler() {
219220
enableFeature(scrollToTopOnCollapse);
220221
enableFeature(addDeleteForkLink);
221222
enableFeature(fixSquashAndMergeTitle);
223+
enableFeature(fixSquashAndMergeMessage);
222224
enableFeature(openCIDetailsInNewTab);
223225
enableFeature(waitForBuild);
224226
enableFeature(toggleAllThingsWithAlt);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import select from 'select-dom';
2+
3+
export default function () {
4+
const button = select('.merge-message .btn-group-squash [type=submit]');
5+
if (!button) {
6+
return;
7+
}
8+
9+
button.addEventListener('click', () => {
10+
const description = select('.comment-form-textarea[name=\'pull_request[body]\']').textContent;
11+
select('#merge_message_field').value = description;
12+
});
13+
}

0 commit comments

Comments
 (0)