cross-posted from: https://programming.dev/post/214031

Have you ever used git bisect? If so, how did you use it? Did it help you find a problem which would otherwise be difficult to find? Story time, I guess?

  • embix@feddit.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 year ago

    Seems like most of the answers are on another instance and my client does not show them here. For those having the same problem: check here.

    Federation is fun and all, but having “the same” sub on multiple instances does not make it easier atm.

  • embix@feddit.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    4-5 times now. When confronted with more than a hundred commits between latest known working version and the one you’ve observed the bug (which was not catched by any of the unit tests) it can save some time to find the fishy commit.

    In such a case I create a testcase on top to reproduce the bug. Then bisect and for each stage add the testcase, build, run tests. FYI: this only works if all (or at least most) of the commits in the chain are compilable - if you’ve done a big messy refactoring with several commits breaking the build, bisect can get you only so far.