4

I work on a project that (for reasons outside the scope of this question) is separated between two git repositories. It's a web project, and has a common library layer (stored in repository A) and a specific project layer (stored in repository B).

Is there an effective working methodology for figuring out which commit introduced a particular bug, given it could be in either repository, using git-bisect? I've tried things like keeping the commit in A constant whilst doing a git-bisect on B, and so on, but the interactions are too complex, as often changes in B were dependent on A, or vice-versa. (These changes aren't relevant to the bug I'm searching for, but do stop the site from loading, and hence me doing a valid test).

Is there a way I can link the two git-bisects so a git bisect good or bad on one repository checks out the commit closest in time on the other one? Or merge them temporarily to test them together somehow?

It would be a start if there's an approach that even just narrows down the scope of the search.

Andrew Ferrier
  • 16,664
  • 13
  • 47
  • 76
  • You should use `git submodule` next time… – kirelagin Jun 07 '13 at 16:56
  • @kirelagin, I actually do have them both as submodules of a "owner" repository - locally. I missed out that detail to simplify things. I'm not sure that helps me though. Can you explain? – Andrew Ferrier Jun 14 '13 at 08:13
  • You just do bisect on you main repository, which is effectively bisecting on a subset of combinations (cartesian product, by the way) of commits in submodules. As a result you'll get a segment in each subrepo. At this point it should be easy to isolate the issue, but if it's not, you can always bisect on those segments in each repository. – kirelagin Jun 14 '13 at 10:53
  • @kirelagin, in theory, yes, I guess that's true. The difficulty is that in this case the 'parent' repository is very rarely committed to (i.e. the subset of the potential cartesian product, as you put it, is very small). If I could figure out a way to generate that 'parent' repo after the fact, though... :) – Andrew Ferrier Jun 14 '13 at 16:53

1 Answers1

1

I think you could bisect A, where your test condition is to bisect B and "bad" is defined as either "site won't load" or "bug I'm looking for".

gcbenison
  • 11,723
  • 4
  • 44
  • 82