Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git-bisect but for N repos

Tags:

git

git-bisect

There is a bug in my code which can be easily reproduced since a test fails.

Up to now I used git-bisect in such cases, but it is only useful if there is only one git repo.

In my case there are 7.

Is there a way to do something like git-bisect but for N git repositories?

Update

There is one "container" Repo this contains mostly config. It is related to a particular customer.

Then there is one repo for the core-application.

Then where are N repos for plugins for this core-application.

Git submodules are not used in this context.

Update2

Up to now I don't use the google repo tool. AFAIK it can't bisect, too.

like image 764
guettli Avatar asked Aug 02 '17 10:08

guettli


People also ask

Is git bisect useful?

The git bisect command is used to discover the commit that has introduced a bug in the code. It helps track down the commit where the code works and the commit where it does not, hence, tracking down the commit that introduced the bug into the code.

How do I stop bisecting?

To end the bisect session at any point, run git bisect reset. Mark the current commit (HEAD) as bad with git bisect bad.

What is bisect command in git?

git bisect help. This command uses a binary search algorithm to find which commit in your project's history introduced a bug. You use it by first telling it a "bad" commit that is known to contain the bug, and a "good" commit that is known to be before the bug was introduced.

How do you find a commit which broke something after a merge operation?

To track down a broken commit, git gives us a very handy tool called git bisect . Git bisect does a binary search to find the broken commit.


1 Answers

  1. First off : find a state when the test passed.

  2. Then : check if the test passes when reverting one single of the 7 repositories

For example, let's say that :

  • the test passed when repositories were at commits :

    A1 A2 A3 A4 A5 A6 A7
    
  • the test doesn't pass when all repositories are at their new HEAD :

    B1 B2 B3 B4 B5 B6 B7
    

try to see if the test passes in the following configurations :

A1 B2 B3 B4 B5 B6 B7   
B1 A2 B3 B4 B5 B6 B7   
B1 B2 A3 B4 B5 B6 B7   
etc ...

If you manage to isolate a single repo this way : you just have to bisect on that one.

like image 55
LeGEC Avatar answered Sep 17 '22 15:09

LeGEC