TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

My favourite Git commit (2019)

229 点作者 neo2006大约 5 年前

18 条评论

bassdigit大约 5 年前
The author spent all the time documenting his journey but totally fails to explain the actual reason of the problem: If the file contains a UTF-8 byte sequence, why is there an attempt to parse it as US-ASCII? I get that it&#x27;s just a wrong space, but if some day somebody actually want to put a UTF-8 char there for some reason, this commit essay wouldn&#x27;t help at all whereas googling stackoverflow seems to deliver (unverified): <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;15947425&#x2F;rake-tasks-fail-with-invalid-byte-sequence-in-us-ascii" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;15947425&#x2F;rake-tasks-fail...</a>
评论 #22520543 未加载
评论 #22521309 未加载
jspash大约 5 年前
I&#x27;m just curious but... did this actually fix anything other than the spec?<p>The reason I ask is that I find myself (with Rails particularly) spending an awful lot of time on maintaining tests that were written by a much younger and much less experienced developer (me, a few years ago).<p>And I&#x27;ve come to the slow realisation that a lot of what I was testing wasn&#x27;t really important.<p>I&#x27;m not saying the author shouldn&#x27;t have written the spec, or that the spec wasn&#x27;t valuable. But maybe the true bug here was that rspec matchers don&#x27;t honour utf-8 spaces and perhaps they should? I dunno. Just thinking out loud here.
评论 #22519927 未加载
pvorb大约 5 年前
I, too, use git commit messages to document the reasoning behind my changes. But I&#x27;m unsure if my colleagues even notice, since they regularly write bad commit messages like &quot;Fix bug&quot; and things like that. Also I regularly find my commit messages got lost, since the reviewer squashed several commits into one.<p>Do you have any tips for establishing a culture of good commit messages?
评论 #22521281 未加载
评论 #22521710 未加载
评论 #22523887 未加载
judge2020大约 5 年前
Previously: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21289827" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21289827</a> (domain has changed since the last post)
评论 #22521102 未加载
ahh大约 5 年前
I do love the social history of good commit messages, and what they teach us about the process of what we do.<p>I will offer one nit here, which is that I <i>always</i> start my commit messages with one-line summaries; this makes it really easy to scan commits (and git is tooled to do this!)
评论 #22519951 未加载
评论 #22520249 未加载
rachelbythebay大约 5 年前
I wonder: what is the bad character? It&#x27;s apparently not 0x20, but what is it? How did it get there? What keeps this from happening again to someone else?
评论 #22520678 未加载
评论 #22520346 未加载
c3534l大约 5 年前
What&#x27;s the latest on how long a commit message should be? Used to be everyone said a message should never be longer than two sentences and that they should be as short as possible so that people actually read them. This thing posted is an essay. Not the haikus I thought was considered best practice.
评论 #22520080 未加载
评论 #22520151 未加载
评论 #22520655 未加载
mroche大约 5 年前
Linking to the mpv commit[0] message brought up in the last discussion[1]. It’s absolutely hilarious, and a great example of someone rage typing after dealing with an issue.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;mpv-player&#x2F;mpv&#x2F;commit&#x2F;1e70e82baa9193f6f027338b0fab0f5078971fbe" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mpv-player&#x2F;mpv&#x2F;commit&#x2F;1e70e82baa9193f6f02...</a><p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21290517" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21290517</a>
s3graham大约 5 年前
My personal favourite commit (as opposed to commit message) <a href="https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;crashpad&#x2F;crashpad&#x2F;+&#x2F;badfacccee" rel="nofollow">https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;crashpad&#x2F;crashpad&#x2F;+&#x2F;badfac...</a><p>(Sadly, the commit message isn&#x27;t great, but clearly it&#x27;s worth that hash.)
sytelus大约 5 年前
Please do not do this. Long essay style commit messages are not really searchable, have no real way of discussions, do not support formatting, images etc and are hard to even read in many tools. A better way is to create an issue first and attach it to your commit.
kimusan大约 5 年前
This is my favorite git commit: <a href="https:&#x2F;&#x2F;android-review.googlesource.com&#x2F;c&#x2F;platform&#x2F;system&#x2F;bt&#x2F;+&#x2F;1241366" rel="nofollow">https:&#x2F;&#x2F;android-review.googlesource.com&#x2F;c&#x2F;platform&#x2F;system&#x2F;bt...</a><p>result:<p><a href="https:&#x2F;&#x2F;android.googlesource.com&#x2F;platform&#x2F;system&#x2F;bt&#x2F;+&#x2F;refs&#x2F;heads&#x2F;master&#x2F;gd&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;android.googlesource.com&#x2F;platform&#x2F;system&#x2F;bt&#x2F;+&#x2F;refs&#x2F;h...</a>
dirtydroog大约 5 年前
That&#x27;s just way too verbose though. There should have been a ticket with a description of the problem. Name the branch after the ticket and jira will automatically link the ticket to the commits that fixed it.<p>I&#x27;ve encountered bad utf-8 when data is copied from excel or outlook.
评论 #22520288 未加载
jariel大约 5 年前
Can someone comment on a best practice whereby the commit might merely refer to the problem ticket (in whatever system), which should have all of the relevant problem histories, and the articulation of the solution? As opposed to all of this documentation in git?
评论 #22521130 未加载
Jefro118大约 5 年前
Does anyone here try to enforce good commit message practices within their engineering teams?
juped大约 5 年前
All that text and it doesn&#x27;t mention that the offending character is a U+00A0 NO-BREAK SPACE with UTF-8 bytes C2 A0.
codegeek大约 5 年前
Tl;Dr: Sometimes, Why is more important than What.
评论 #22523466 未加载
评论 #22521132 未加载
neo2006大约 5 年前
It&#x27;s not only about the fact that the commit message for a one char change is about a page long. It&#x27;s about that all the information in that page long commit message is a useful information
评论 #22520045 未加载
评论 #22519910 未加载
bassdigit大约 5 年前
Paraphrasing the first comment of the commit[1]:<p>A commit message with such a long explanation helps nobody, because it is not searchable by Google, not even by GitHub[2]. [...] If the commit message requires a blog post to be good (searchable) – it is a poor commit message.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;alphagov&#x2F;govuk-puppet&#x2F;commit&#x2F;63b36f93bf75a848e2125008aa1e880c5861cf46#commitcomment-35571322" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;alphagov&#x2F;govuk-puppet&#x2F;commit&#x2F;63b36f93bf75...</a><p>[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;search?q=invalid+byte+sequence+in+US-ASCII&amp;type=Commits" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;search?q=invalid+byte+sequence+in+US-ASCI...</a>
评论 #22538758 未加载
评论 #22522177 未加载