[BUG] Merging a pull request does not pickup title updates

Problem

Updated Pull Request titles are not the title / subject of a Merge

How to reproduce

All steps are through the web interface

  1. Create a pull request
  2. Update the title of the pull request
  3. Click the merge button.
    The title / subject of the merge is the original title, not the current title

Background

This is really annoying when repo’s have actions based off the commit title. eg Merges / commits must include tickets, Actions are dependant on the first line (title) of the commit message.

The Pull Request title and description shown in the pull request page on GitHub are unrelated to the actual commit message that will end up in the repository history.

If you want to change the title or message of a commit belonging to a pull request, you’ll need to amend the commit locally and then force push it again, which will update the pull request commit too.

There are various reasons why it’s a good idea to keep the title and text of the PR page separate from that of the actual commit:

  • A single pull request might contain multiple commits, but for practical reasons having a single description of the whole changes set is easier to review.
  • Commit messages are hard wrapped (usually at column 72), whereas you’d prefer to show the PR description as flowing text on the PR web page.
  • The PR page can use markdown formatting, whereas commit messages are not processed for markdown on GitHub.
  • Usually a PR description in the web page will provide more info than the actual commit(s), for its intended for the admins who are reviewing it, whereas commit messages should be kept down to the bare essential, avoiding verbosity.

I’m raising the issue of consistency which a force push will not correct,
If you change the PR subject the Merge subject retains the original subject.
I appreciate that the content of the merge commit message is typically an aggregation of the commit messages. A number of CI pipelines perform actions based on the commit message, eg [skipci] is a common one.

If someone raises a PR without this tag they can go back and amend the subject / title of the PR, however when the PR is later merged in via the web interface the tag that was added to the PR title is not in the title box of the merge / squash merge. This has caught out a number of people I work with.

q) Why did CI do something I wasn’t expecting?
a) Your merge did not contain the correct tags
q) But I amended the PR title to have the correct tags
a) The person that merged it didn’t ensure the merge retained those tags