truncating first line of commit message too agressive #12450
Replies: 15 comments 7 replies
-
Upvoted, but I don't need it to be fancy with per repo options, I just don't want someone at GitHub deciding that they know better than I do what is appropriate for my commit messages. It's as bad as the smart links stuff in Atlasssians products. I didn't give them permission to alter my words either. |
Beta Was this translation helpful? Give feedback.
-
Note that there isn't currently any wrapping or truncation for commi
messages as such: this only happens when you make a PR consisting of a
single commit - so it's really not protecting anyone from long first lines,
except in a single particularly annoying situation...
…On Wed, 13 Apr 2022, 09:24 Frederick Zhang, ***@***.***> wrote:
To be clear, I'm not very against the idea of stopping truncating commit
subjects; I'm against doing this without adding any warnings.
Of cos it's not true that 'someone at GitHub ... know[s] better than [you]
do', and in an ideal world we don't need any restrictions or warnings on
GitHub's side. But in reality there are already enough devs who manage to
squeeze a small paragraph with 200 characters followed by a full Jira URL
into commit subject line without caring how many characters can get
truncated by GitHub. The situation can only get worse if we stop truncating
without adding any warnings.
So I think the 'per-repository option' mentioned by OP is actually a
*must* if this request gets picked up by GitHub.
—
Reply to this email directly, view it on GitHub
<#12450 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFMVA4RLMP6RJP3662RGDVEZSAZANCNFSM5P764WXQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Others here have stated things similarly, but I just want to reiterate: GitHub does not know better than I do in terms of intent. If I choose to make my title long, that's my choice... 99.999% of the time when GitHub has truncated my text in the PR title, I've gone to the description, cut that text, and re-added it to the title. Let teams decide what works for them; don't force your opinions on us... |
Beta Was this translation helpful? Give feedback.
-
is there any chance this will ever get addressed? github unilaterally deciding to mess with our commit messages to generate the PR title is one of the most annoying features - it is not helping, and was a bad idea from the start. This is not really even whether you think the 50/72 rule is a good idea or needs to be consigned to the dustbin of green-screen history. Simply this: the PR title is being generated from an existing commit, so github should just graciously step out of the way and assume that whatever commit standards one has adopted, they have already been applied when the original commit was written. github even admits it doesn't really care about the line length because when we go and change it back to the original, gloriously long full sentence, it doesn't complain or even give a warning. so please... just stop it;-) |
Beta Was this translation helpful? Give feedback.
-
Sometimes having a long and descriptive title is the right choice and GitHub shouldn't really mess with it, I mean, |
Beta Was this translation helpful? Give feedback.
-
Just to add another point to this, if you're in a team that uses a commit formatting convention (such as Conventional Commits or something similar) your commit messages are made longer by the prefixes and scopes that feed into other tools. When creating a PR this doesn't serve much purpose in the title, however the additional length causes the (more important) subject of the commit message to be moved into the PR description. Most of the time I find myself removing the prefix in the autogenerated title (e.g. In cases like this the 72 character limit is further condensed to impossibly short messages that would incentivize omitting any useful description from commits overall. I would love to see an option to increase this limit per repo (or the removal of the truncation entirely, but I understand the argument against that) so that I can simply remove the parts I don't want manually rather than having to also edit the description. |
Beta Was this translation helpful? Give feedback.
-
This could be solved by extending the PR template system that is already available to also allow specifying a title, similar to issue templates, ideally with an optional truncation setting. |
Beta Was this translation helpful? Give feedback.
-
Literally almost every PR I create has this issue. Partly because the PR title (and the original commit) show structure around what was changed. And usually, the difference is around 10 characters but I'd much prefer that GitHub just trusts me as an admin of my repo (and probably anyone else). Reviewing PRs INCLUDES checking the name of the PR. And we can write automation around that. GitHub is in many respects the most developer-centric platform, but this is exactly the opposite. |
Beta Was this translation helpful? Give feedback.
-
20+ years ago such limit would be very reasonable , especially for CRT screens :) |
Beta Was this translation helpful? Give feedback.
-
Please fix this. So much time wasted on every PR cutting the second half of my commit message back into the title field. I don't want truncation to happen ever. |
Beta Was this translation helpful? Give feedback.
-
Adding support for this change, we've just moved to GitHub for our repo and I'm shocked by this odd, highly opinionated behaviour. |
Beta Was this translation helpful? Give feedback.
-
If it's too hard to make it configurable, please just increase it to a 100. Current PR UI can display even more than that. |
Beta Was this translation helpful? Give feedback.
-
Adding support for this change. Allowing for longer PR titles would be helpful in avoiding manually having to go in and change them. |
Beta Was this translation helpful? Give feedback.
-
I would like to point out that |
Beta Was this translation helpful? Give feedback.
-
This is maddening. Here's a Tampermonkey userscript I wrote to fix it (not super well-tested yet, let me know if any bugs). https://gist.github.com/lionel-rowe/472d3de7738494746e5015d31220b748 |
Beta Was this translation helpful? Give feedback.
-
Currently when a PR is composed of a single commit, the first line of that commit becomes the PR title.
When the first line is longer than 72 characters it is truncated with trailing "..." and the rest is moved to description with a leading "..." in front.
I have a hard time coming up with a scenario where this would be a good PR title and description. The original long title is almost always preferable. If a shorter title is desired the truncated one is still non-sensical and a new one needs to be written by a human. It is still possible to submit a PR with a long title, but that requires manual copy-pasting.
Suggested alternative: don't truncate the text, just add a warning label TITLE LONGER THAN 72 CHARACTERS.
Those who want to edit can, but don't need to undo machine-edits first. Those who want to submit with a long title can, without need to undo machine edits first.
As a bonus, this could be a per-repository option:
Beta Was this translation helpful? Give feedback.
All reactions