29

Another real-world argument for why I always say git is worth learning properly.

Had to track a really weird bug down today. Had no idea where it came from, how long it'd been in the code and hadn't the foggiest what was causing it. Realistically it could have been introduced any time in the last year or two, and that's tens of thousands of commits in this repo.

Git to the rescue. Knocked up a quick script to test the case in question, fed it into "git bisect run", and 30 seconds later git found the exact (small) commit that caused the issue.

It's a brilliant part of git, yet it seems like almost no-one I know uses it. Some use "git bisect", but using "git bisect run" and passing a script to it seems to be alien to most - yet it's probably my most used tool when it comes to tracking down bugs like these.

Comments
  • 2
    Never heard of git bisect, I will look into it. Thanks
  • 1
    Happy to help! :-)
  • 1
    Never heard of it, awesome ! Gonna test it out immediately :)
  • 1
    I never worked with git and I know about bisect... How can people be so uninformed about their everyday tools?
  • 3
    @StefanGliga I read about it this morning and looking back I've never been in a situation where bisect would be the best option to use.

    I'm currently having such an issue but using SVN...
  • 2
    @StefanGliga When you use a tool on a daily-basis, you tend to use what you know. You only use something different when you actually live that case. For example, i have never been in a situation that requires this, so i never heard of it.
  • 2
    @Codex404 There is an old SVN bisect perl script that may help: https://metacpan.org/pod/release/...

    It's not baked into SVN though.
  • 1
    Today I learnt about git bisect run. Never saw that before. Will definitely be useful.
Add Comment