[llvm] [docs] Advise contributors to check for truncated PR titles (PR #68021)

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 12:10:08 PDT 2023


https://github.com/asb created https://github.com/llvm/llvm-project/pull/68021

GitHub will use the first line of the commit as the title for a single-commit PR, but truncates it at 72 characters <https://github.com/orgs/community/discussions/12450>. This truncation makes the PRs less readable if not manually undone, and even worse, the truncated form may survive through to commit if "Squash and rebase" is used in the GitHub web UI. From preparing LLVM Weekly, I've seen this a number of times and it really does make it more annoying to flick through commits.

I'm not sure if this is the best place for the guidance, or whether you get the same behaviour when creating a PR with `gh`, but I'm quite keen we give a warning of some sort about this behaviour.

>From a6d09becf46adff24062588cb69ce0cc6f0d3302 Mon Sep 17 00:00:00 2001
From: Alex Bradbury <asb at igalia.com>
Date: Mon, 2 Oct 2023 20:04:51 +0100
Subject: [PATCH] [docs] Advise contributors to check for truncated PR titles

GitHub will use the first line of the commit as the title for a
single-commit PR, but truncates it at 72 characters
<https://github.com/orgs/community/discussions/12450>. This truncation
makes the PRs less readable if not manually undone, and even worse, the
truncated form may survive through to commit if "Squash and rebase" is
used in the GitHub web UI. From preparing LLVM Weekly, I've seen this
a number of times and it really does make it more annoying to flick
through commits.

I'm not sure if this is the best place for the guidance, or whether you
get the same behaviour when creating a PR with `gh`, but I'm quite keen
we give a warning of some sort about this behaviour.
---
 llvm/docs/GitHub.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/llvm/docs/GitHub.rst b/llvm/docs/GitHub.rst
index 79f1479716faefa..67fea9520aab6de 100644
--- a/llvm/docs/GitHub.rst
+++ b/llvm/docs/GitHub.rst
@@ -50,6 +50,9 @@ Create a local branch per commit you want to submit and then push that branch
 to your `fork <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks>`_
 of the llvm-project and
 `create a pull request from the fork <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork>`_.
+As GitHub uses the first line of the commit message truncated to 72 characters
+as the pull request title, you may have to edit to reword or to undo this
+truncation.
 
 Creating Pull Requests with GitHub CLI
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



More information about the llvm-commits mailing list