News for hackers. Stuff that matters.
Re:Yesterday, my program worked. Today, it does not. Why? (1... by warpech on Wednesday July 19, 2017 @06:08AM (#14803177)
Reminds me of one of the nice features of Git: git bisect. Find the breaking commit in the smallest number of steps.

Some random blog post about it: http://webchick.net/node/99

Re:Yesterday, my program worked. Today, it does not. Why? (1... by Anderkent on Wednesday July 19, 2017 @09:49AM (#14804234)
The algorithm described in the article, if I'm reading it correctly, is more powerful than git bisect, because it can identify the exact change within a commit that causes the bug. You could for example decide to make each file modification in a commit a different 'Change', and so the algorithm would identify not only which commit breaks something, but which file changes are relevant.
Re:Yesterday, my program worked. Today, it does not. Why? (1... by alttab on Wednesday July 19, 2017 @10:05AM (#14804335)
This would be difficult to determine - as running tests without some changes in non-deterministic way could affect testing or the program's ability to run properly.
Re:Yesterday, my program worked. Today, it does not. Why? (1... by Anderkent on Wednesday July 19, 2017 @10:11AM (#14804365)
The article covers that.
Re:Yesterday, my program worked. Today, it does not. Why? (1... by epmatsw on Wednesday July 19, 2017 @11:59AM (#14805272)
I think what blew my mind most was `git bisect run`. Write a test case, go get coffee, have git spit out the offending commit automatically. So cool.
Re:Yesterday, my program worked. Today, it does not. Why? (1... by hacker_9 on Wednesday July 19, 2017 @06:12AM (#14803207)
Used this the other day! Had to track down a visual bug that was introduced in the last 20 commits, but with binary search I could narrow down on the problem a commit at a time and so only had to look at 4 in total.
Re:Yesterday, my program worked. Today, it does not. Why? (1... by pmarreck on Wednesday July 19, 2017 @09:40AM (#14804178)
how am I not surprised that this solved a regression that occurred at some point in the past on a Drupal project

I worked on a Drupal project... Once.

Re:Yesterday, my program worked. Today, it does not. Why? (1... by sethrin on Wednesday July 19, 2017 @04:04PM (#14807439)
I believe Joomla is worse in every conceivable way. And then of course there is WordPress, which I sincerely hope is the last major procedurally-written codebase. PHP has come a long way as a language (it can almost be confused for something sensible these days) but lots of issues with large libraries.
Re:Yesterday, my program worked. Today, it does not. Why? (1... by pmarreck on Thursday July 20, 2017 @12:33PM (#14813946)
That's why I left the Ruby ecosystem and went to Elixir. I noticed that my coding style was getting more and more functional (just naturally... but I was also probably influenced by Rich Hickey's "Are We There Yet?" talk, and by Gary Bernhardt's "Boundaries" talk) and soon realized that functional nirvana was essentially unachievable in Ruby as long as I depended on a vast library of gems all of which were procedural/OO.

Leaped and haven't looked back yet. Great stuff.

Re:Yesterday, my program worked. Today, it does not. Why? (1... by sethrin on Thursday July 20, 2017 @07:16PM (#14816995)
I started in PHP, migrated to Ruby, and now I think I am beginning to be annoyed at Ruby's occasional lack of expressivity. I am probably on a similar course towards FP nirvana. Do you know any place on the left coast that's playing with Elixir or Haskell?
Re:Yesterday, my program worked. Today, it does not. Why? (1... by pmarreck on Sunday July 23, 2017 @07:17PM (#14834889)
More places than on the right coast! :O
Re:Yesterday, my program worked. Today, it does not. Why? (1... by sethrin on Monday July 24, 2017 @12:39PM (#14839942)
Fair enough. I'll let you know when I find it :)
Re:Yesterday, my program worked. Today, it does not. Why? (1... by azhenley on Wednesday July 19, 2017 @09:45AM (#14804206)
This is awesome. Didn't know about it, thanks!

My approach has been to step exponentially. I go back 1 commit, 2 commits, 4 commits... etc. I'll be using bisect from now on though.

Re:Yesterday, my program worked. Today, it does not. Why? (1... by pishpash on Wednesday July 19, 2017 @10:58AM (#14804743)
You may be implementing an intuitive weighted bisect :)
Re:Yesterday, my program worked. Today, it does not. Why? (1... by maccard on Wednesday July 19, 2017 @12:17PM (#14805410)
Heh, I do a binary search. Find last known good build, go half way between, etc
Re:Yesterday, my program worked. Today, it does not. Why? (1... by muxxa on Wednesday July 19, 2017 @03:24PM (#14807111)
I wish git bisect could handle the 'find last good build' step by jumping back exponentially through history, then switching to binary search once the last good build is found
Re:Yesterday, my program worked. Today, it does not. Why? (1... by ChronosKey on Wednesday July 19, 2017 @12:26PM (#14805478)
That's what git bisect does
Re:Yesterday, my program worked. Today, it does not. Why? (1... by maccard on Thursday July 20, 2017 @03:21AM (#14810606)
And not everyone uses git, unfortunately.
Re:Yesterday, my program worked. Today, it does not. Why? (1... by mcintyre1994 on Wednesday July 19, 2017 @12:27PM (#14805481)
This is what git-bisect does :)
Re:Yesterday, my program worked. Today, it does not. Why? (1... by devrandomguy on Wednesday July 19, 2017 @09:34AM (#14804140)
Git bisect is awesome. Before I discovered it, I was manually bisecting the codebase, and stubbing out the missing half.
Re:Yesterday, my program worked. Today, it does not. Why? (1... by adrianratnapala on Wednesday July 19, 2017 @09:49AM (#14804236)
Not to take away from git bisect (or hg bisect, which is no more broken than the rest of mercurial) -- I don't think it is an alternative to the thing you used to do.

git bisect is "temporal bisection", i.e. you delete half of a time interval. The manual bisect is kinda-sorta "spatial" in the sense that you delete half a region of code. the two things work by similar principles, and their problem domains overlap -- but they are not the same.

Re:Yesterday, my program worked. Today, it does not. Why? (1... by MaulingMonkey on Wednesday July 19, 2017 @07:32PM (#14808904)
They're complimentary techniques. One might git bisect down to the commit level, then manually bisect the sub-changes in the commit if it's a large one.

I've done the manual equivalent in perforce as well.