TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The shortest pull request ever

133 pointsby julienpalardover 2 years ago

8 comments

djha-skinover 2 years ago
&gt; If we drop those markers (1110 and 10 in front of bytes) and keep the remaining bits we&#x27;re left with 1111111011111111, which evaluates to 65279, which is in hexadecimal 0xfeff. Yes, you recognize it, it&#x27;s a BOM. Because yes a BOM is just a ZERO WIDTH NO-BREAK SPACE, isn&#x27;t it beautiful?<p>Byte Order Marks have stolen hours and days of my life. Anyone suffering the pain of developing on a windows box can relate. Windows puts BOMs by default in the front of every file. Thus windows programs silently ignore it, but then linux machines run the program and choke on the BOM. You have to specifically ask the editor if the BOM is even there, it doesn&#x27;t show up in the editor by default. I have specific lines in my .vimrc[1] that prevent BOMs from ruining my day&#x2F;week, but they still pop up often. I often joke there will be a byte order mark on my tombstone, along with avahi daemon.<p>1: <a href="https:&#x2F;&#x2F;git.sr.ht&#x2F;~djha-skin&#x2F;dotfiles&#x2F;tree&#x2F;main&#x2F;item&#x2F;dot-config&#x2F;nvim&#x2F;init.vim#L123" rel="nofollow">https:&#x2F;&#x2F;git.sr.ht&#x2F;~djha-skin&#x2F;dotfiles&#x2F;tree&#x2F;main&#x2F;item&#x2F;dot-con...</a>
评论 #33101586 未加载
评论 #33103759 未加载
评论 #33102101 未加载
评论 #33101972 未加载
评论 #33103570 未加载
donatjover 2 years ago
Over the years I&#x27;ve submitted a decent number of pull requests just removing execute bits from files that shouldn&#x27;t be executable.<p>They always end up +0-0 - see:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ICanBoogie&#x2F;Inflector&#x2F;pull&#x2F;38" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ICanBoogie&#x2F;Inflector&#x2F;pull&#x2F;38</a>
christiangencoover 2 years ago
My high school english classes would upload any papers students wrote to a site that would check for plagiarism. I figured out that if I inserted random zero-width no-break spaces in the middle of words my plagiarism score would drop to zero.<p>Presumably the plagiarism system was just looking for exact matches of long substrings.
评论 #33101781 未加载
评论 #33101670 未加载
评论 #33101773 未加载
评论 #33101672 未加载
verandaguyover 2 years ago
I mean, it&#x27;s the shortest _possible_ pull request (since I don&#x27;t think you can make a git diff of zero bytes, barring some weird quirk), but also probably has the highest PR description : PR diff length ratio of any PR I&#x27;ve seen.
评论 #33101959 未加载
评论 #33101513 未加载
评论 #33101523 未加载
评论 #33101775 未加载
评论 #33101519 未加载
k470over 2 years ago
I love the title. I like to ask for pull requests with this exact description to influence my coleagues to look at it faster when it&#x27;s something small like a single character. For example, when it&#x27;s a two character PR I say &quot;hey, the second smallest pr in the world&quot;. Guess I was wrong!
remramover 2 years ago
You can easily check in your CI that your files are ASCII (code should probably be) with file(1). There is probably an off-the-shelf-tool that can validate that all characters are printable, ASCII or unicode.
pabs3over 2 years ago
Is there a tool to check for byte order marks, zero width spaces and other &quot;weird&quot; Unicode characters?
评论 #33103774 未加载
tmalyover 2 years ago
Jesus wept