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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: Sedy, a GitHub Bot Bringing Linux Sed to Code Reviews

144 点作者 Kmaschta大约 8 年前

13 条评论

unholiness大约 8 年前
Cool! Looks like a genuinely useful tool, reducing some pretty common friction within the code review process.<p>Three features I&#x27;d want before using it:<p>1) Rather than triggering Sedy immediately on a reviewer comment, I&#x27;d like the trigger to be the original requester <i>reacting</i> to the comment with a thumbs-up. The requester knows what they&#x27;re trying to say, and they should decide if the changes get made.<p>2) I wish there were an option to restrict it to comments for supported languages. Your examples are just changing markdown (not code), and I think rightfully so — I can easily see this tool becoming a way for a senior dev reviewer to attempt to avoid the back-and-forth with a junior dev by just posting some complex code substitutions... substitutions which could easily screw things up.<p>3) sed replacement actually seems <i>too</i> powerful for this job. For instance, if I want to make a replacement like:<p><pre><code> s&#x2F;**bold** thing&#x2F;**bold thing**&#x2F; </code></pre> ...I really don&#x27;t want to try escaping that without feedback. I&#x27;d rather have direct string replacement without regex than the full power of sed. This probably goes against your design goals, but for me it would be much more useful.
评论 #13754218 未加载
评论 #13754028 未加载
评论 #13758649 未加载
LukeShu大约 8 年前
I share with fiatjaf&#x27;s sentiment; this is an amazingly cool piece of hackery (that will probably be very useful to many people), but I won&#x27;t use it.<p>For those simple types of changes, I like to amend the original commit, rather than make a new one. Of course, I come from using `git send-email` to send patches to a mailing list, where you are expected to send &quot;[PATCH v2]&quot; after you get feedback.
评论 #13754214 未加载
评论 #13754813 未加载
jlv2大约 8 年前
&quot;Linux sed&quot;? There&#x27;s no mention of Linux at <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sed" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sed</a>
评论 #13756762 未加载
评论 #13756293 未加载
TazeTSchnitzel大约 8 年前
I forget the exact circumstances, but I was once in a W3C IRC chatroom which had a bot that produced a transcript and obeyed sed commands. It&#x27;s pretty amazing to be able to type s&#x2F;their&#x2F;they&#x27;re&#x2F; and have it actually take effect.
评论 #13754399 未加载
fiatjaf大约 8 年前
Whoa.<p>I will not use this, but I can say this is an amazing piece of hackership.
评论 #13753867 未加载
pvg大约 8 年前
In the first screenshot, how does the bot know which instance of &#x27;products&#x27; to change? Also &#x2F;s&#x2F;themself&#x2F;themselves for the second one although chances are Sedy can&#x27;t edit screenshots.
评论 #13754455 未加载
partycoder大约 8 年前
What I do to point out differences is to provide a comment with a code block with diff format.<p>```diff<p>-- old text<p>++ new text<p>```<p>Github will highlight that as a diff.
评论 #13755323 未加载
k2xl大约 8 年前
I know in bitbucket and others have a nice feature that allows you to edit code inline on the web browser and commit the changes - wouldn&#x27;t that be a safer approach than editing via commenting? I don&#x27;t think it would take much more time either.<p>Maybe doing the reverse, if a change is made through inline edit automatically add a comment with the specific change made.<p>I just can foresee undesired consequences. Someone not escaping their sed correctly (I.e. they try to replace a string with a slash or apostrophe)
评论 #13754123 未加载
willcodeforfoo大约 8 年前
`&#x2F;s&#x2F;foo&#x2F;bar` syntax works in Slack as well!
jwilk大约 8 年前
&gt; Since we need to accept the invitation on behalf of the Sedy bot, you’ll have to notify us about it. For the time being, we only accept notifications by postcard<p>Huh?
评论 #13757170 未加载
c3RlcGhlbnI_大约 8 年前
How much of the power of sed does it bring?<p>I feel like other sed expressions might be even more useful in this format. For example:<p><pre><code> 200i #TODO optimize this </code></pre> will insert a comment before line 200 and:<p><pre><code> s&#x2F;.*goto.*&#x2F;cowsay \0&#x2F;e T s%^%&#x2F;&#x2F;% s%\n%\0&#x2F;&#x2F;%g </code></pre> will take every line that contains a goto and replace it with a commented out cowsay version of itself.
Sir_Cmpwn大约 8 年前
Does s:&#x2F;bin:&#x2F;usr&#x2F;bin:g work?
评论 #13753947 未加载
leog7大约 8 年前
This is a nice implementation of sed, but what if you replace something you did not intend to?
评论 #13781814 未加载