Refined-github: Preserve PR merge commit description when not squashing

Created on 6 May 2020  ·  7Comments  ·  Source: sindresorhus/refined-github

First of all, thank you for making this amazing extension!

Problem

2564 clears up the PR merge commit description, which makes sense when squashing commits as the issue described, but it also clears the description when making a merge commit (not squashing).

When you make a merge commit, the description field is filled with the PR title, which is nice to have. Can we preserve it when not squashing commits?

How to reproduce

🐞 The extension enabled:

enabled

✅ The extension disabled:

disabled

change request

All 7 comments

If anything the exception should be squashed commits, not merge commits:

With merge commits, the full “Fix punctuation” commit will appear in the history right below it; why also add it to the description?

If you don’t like the feature, you can disable the it.

Let me elaborate this more. The example I provided above was not a good one.

For instance, let's say the title of a PR is Introduce Feature A and commits are like

  • Implement method X
  • Write tests for X
  • ...

The PR title would be a good summary when we merge the commits without squashing.

Sadly, I had to disable this feature for projects where people don't squash, but I'm working on several projects and this is a good feature for projects where people do squash. Just thought this feature was only for squashing commits according to the initial issue.

Sadly, I had to disable this feature for projects where people don't squash

That's fair.

Let me elaborate this more. The example I provided above was not a good one.

Again, it applies to both merged and squashed commits:

Squashed commits

If you want to see the commits list:

  • click the PR link in the commit title

Merged commits

If you want to see the commits list:

  • click the PR link in the commit title
  • see the commits already below it in the git history ⬅️ ⬅️

There are already 2 ways to see commits in this case. If anything this feature makes more sense for merge commits than it does for squashed commits. 😅

Just thought this feature was only for squashing commits according to the initial issue.

Indeed, I mentioned squashed commits because that's what I generally use.

Ah, I see. Sorry for my bad clarifications. What I want to see is not the commits but the PR title, and I was imagining that checking the PR title on my local machine not on GitHub. But you are suggesting I go to GitHub to see the PR title, which definitely works as a workaround:)

Sorry for confusing you by talking about commits (which is the main point of the feature) but it's more about the PR title.

Let me show an example using squash/non-squash PRs

$ git log
===== this is a squashed PR result (https://github.com/tiwanari/repo-for-issue-reports/pull/2) =====
commit (omitted)
Author: Tatsuya "Nari" Iwanari <[email protected]>
Date:   (omitted)

    Implement a cool feature (#2) <- Squash PR shows the title here

    (<-- Removed commits using the cleanup feature, which feels great:D -->)

===== the following commits are a non-squashed PR result (https://github.com/tiwanari/repo-for-issue-reports/pull/1) =====
commit (omitted)
Merge: 0503bf2 0e7b872
Author: Tatsuya "Nari" Iwanari <[email protected]>
Date:   (omitted)

    Merge pull request #1 from tiwanari/feature/test_merge_commits

    Implement an awesome feature <- I'm losing this PR title due to the cleanup

commit (omitted)
Author: tiwanari <[email protected]>
Date:   (omitted)

    Add tests for main.py

commit (omitted)
Author: tiwanari <[email protected]>
Date:   (omitted)

    Implement main.py

I personally love squash as it generates cleaner history but I also like making commits finely so that we can look back what changes people made and why easily.

Anyway, it doesn't stop me from using this cool extension at all. It was just a little surprise when I noticed this situation.

Hello! I just found out about this feature in refined-github, in my case was on merge squash not filling with the commit messages

I would just like to mention why is important for me first, what I need is to generate CHANGELOG.md with semantic-release + commit-analyzer, it's very useful and popular among npm libraries

@fregante you mentioned about disabling the feature, how can I do that with refined-github? I looked at the README.md but I couldn't find

@fregante you mentioned about disabling the feature, how can I do that with refined-github? I looked at the README.md but I couldn't find

@luan-orlandi-ifood : you can find and disable features of Refined GitHub in the extension's settings - about:addons ( Firefox ) / chrome://extensions ( Chrome ) and then finding the extension from the list. You can also right-click the extension's icon on the browser toolbar and click Manage Extension to get directly to the extension's page. On the extension's page, find the Preferences option. It will have a list of all the features that are enabled or disabled by Refined GitHub.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mareksuscak picture mareksuscak  ·  3Comments

sindresorhus picture sindresorhus  ·  3Comments

alexanderadam picture alexanderadam  ·  3Comments

sompylasar picture sompylasar  ·  3Comments

juliocanares picture juliocanares  ·  3Comments