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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Git Bisect-Find

50 点作者 nalgeon大约 1 年前

8 条评论

vladf大约 1 年前
Ah! Finally a real world use for egg drop (with eggs and floors both equal to num commits since init, but maybe fewer eggs for those less patient).
评论 #40094621 未加载
评论 #40098453 未加载
sltkr大约 1 年前
For the algorithmically inclined, this is basically exponential search: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Exponential_search" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Exponential_search</a>
sjburt大约 1 年前
if you don&#x27;t know what commit is good, just go way way way back. Go back 10,000 commits instead of 1,000. The magic of bisection search is that opening your search window by 10x only adds 3 (well, 3.332) extra bisections.
评论 #40096017 未加载
yarg大约 1 年前
I scripted something similar at an old workplace;<p>Basically you&#x27;d pass a command to the script and it would track down the last commit that did not fail the command.<p>It&#x27;d search HEAD~4, HEAD~8, HEAD~16... until it found a good commit, then bisect.<p>The problem that I found is that bugs that have already been fixed still triggered in the past, and the only solution that I found to that was to branch the first buggy commit, apply a fix and squash and then rebase on top of that.<p>Not the best practice, but it saved me a lot of time.
KTibow大约 1 年前
&gt; Obviously jumping right to the first commit would reduce the number of git bisect-find steps. But would result in more git bisect.<p>Putting in a number of months&#x2F;years ago to start from would be a good middle ground.
评论 #40098427 未加载
YoshiRulz大约 1 年前
&gt; I do wonder if jumping back by twice as much is optimal.<p>Some time ago, the idea came to me of weighting commits by diff size (as in LOC added + LOC removed, no thought to binary files), and using that to pick the halfway point for bisection. I&#x27;m not familiar with Git internals so I left it there. But I imagine that, while it wouldn&#x27;t make a huge difference in either case, it would benefit your tool more than it would a regular bisect.
评论 #40095674 未加载
评论 #40097614 未加载
thealistra大约 1 年前
Do people really use bisect in their professional life?<p>Can you sensibly use it without an enforcement of every PR being squashed, as otherwise you have not working, half baked commits all the time while bisecting? And you can’t compile, not even saying about stating if your bug is still reproducible or not.
评论 #40094360 未加载
评论 #40094858 未加载
评论 #40094235 未加载
评论 #40094250 未加载
评论 #40094248 未加载
评论 #40094310 未加载
评论 #40095293 未加载
评论 #40094219 未加载
评论 #40094485 未加载
评论 #40095264 未加载
评论 #40094461 未加载
评论 #40094257 未加载
评论 #40094430 未加载
评论 #40094634 未加载
评论 #40094233 未加载
评论 #40095466 未加载
评论 #40094353 未加载
vagab0nd大约 1 年前
&quot;2024&#x2F;05&#x2F;19&quot;, &quot;Posted in 30 days&quot;<p>Premature announcement?
评论 #40094008 未加载