SlideShare a Scribd company logo
Automated debugging with git
Amit Nijhawan
2
What is git bisect?
●
Use binary search to find the commit that introduced a bug.

So what does that mean?
3
Divider Slide
The basic git bisect workflow
4
Basic bisect commands: start, bad, good
$ git bisect start
$ git bisect bad # Current version is bad
$ git bisect good
5
How to verify good and bad commit using bisect tool?
 First, we need to let git know that we are going to start bisect
procedure:
git bisect start
 Next, we will let git know which commit is bad, if the current commit is
bad, you don't have to specify the hash:
git bisect bad
 Then, we let git know which commit is surely a good one (in this case,
it is the Initial commit, we have to specify the hash)
git bisect good c1417d3
6
 At this point, git start checking and it will let you know how many
remaining commits to check and which commit it is checking now (git
will choose the commit at the middle of your selected range at the
beginning)
Bisecting: 2 revisions left to test after this (roughly 1 step)
[f6ce7408ad0826436c00eb94b7973a965362bc4c] Add container
 Yeah, git automatically checks out the commit Add container. Our job
is run our code and let git know if this commit contains bad code or
not. In our case, this is a bad commit, so we let it know that it is bad.
git bisect bad
7
 Yeah, now git knows this commit is bad, so it does not need to check
all the commits later than this commit. You have just reduced the
search range to a half (binary search)
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[f258f1ce329e4a9dc29bc28e5b03b94838f50333] Add styles
 Let's say that this commit is good, we will run
git bisect good
8
 Git now is able to conclude which is the first bad commit
THANK YOU
Ad

Recommended

PDF
Enjoy fighting regressions_with_git_bisect
Christian Couder
 
PDF
git-commands-cheat-sheet-infopediya-com.pdf
murad khan
 
PPTX
Git - Simplified For Testers
upadhyay_25
 
PPTX
git KT .pptx
sumit583388
 
PPTX
Git and GitHub
Md. Ahsan Habib Nayan
 
PDF
Git with the flow
Dana White
 
PDF
Git in gear: How to track changes, travel back in time, and code nicely with ...
fureigh
 
PPTX
Git & GitHub 101farwsfrwvnfuvnvjvvv.pptx
sihoxe6756
 
PDF
Git and Testing
Christian Couder
 
PDF
JavaScript Community Webinar #14 "Why Is Git Rebase?"
GlobalLogic Ukraine
 
PDF
Git It
Michele Mattioni
 
DOCX
Git github
Anurag Deb
 
DOCX
Bitbucket
hariprasad1035
 
PDF
Git_tutorial.pdf
AliaaTarek5
 
PDF
Introduction to git, an efficient distributed version control system
AlbanLevy
 
PPTX
Version control, you git
Mayur Patil
 
PDF
Git for Beginners
Rick Umali
 
PPTX
Hello git - a soft introduction to git (Talk Slides)
Amity University Noida
 
PDF
Git and Github slides.pdf
Tilton2
 
PDF
Git and Github workshop ppt slide by slide
RaghavendraVattikuti1
 
PDF
Managing releases effectively through git
Mohd Farid
 
ODP
Git presentation
Vikas Yaligar
 
PDF
Introduction to Git for Artists
David Newbury
 
PDF
Git for Writers: Dumping the Bucket Metaphor
Mysti Berry
 
PPTX
Introduction To Git Workshop
themystic_ca
 
ODP
How to use git without rage
Javier Lafora Rey
 
PDF
Git-r-Done
Cesar Martinez
 
PDF
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Shabista Imam
 
PDF
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
hosseinihamid192023
 

More Related Content

Similar to Automated debugging with git (20)

PDF
Git and Testing
Christian Couder
 
PDF
JavaScript Community Webinar #14 "Why Is Git Rebase?"
GlobalLogic Ukraine
 
PDF
Git It
Michele Mattioni
 
DOCX
Git github
Anurag Deb
 
DOCX
Bitbucket
hariprasad1035
 
PDF
Git_tutorial.pdf
AliaaTarek5
 
PDF
Introduction to git, an efficient distributed version control system
AlbanLevy
 
PPTX
Version control, you git
Mayur Patil
 
PDF
Git for Beginners
Rick Umali
 
PPTX
Hello git - a soft introduction to git (Talk Slides)
Amity University Noida
 
PDF
Git and Github slides.pdf
Tilton2
 
PDF
Git and Github workshop ppt slide by slide
RaghavendraVattikuti1
 
PDF
Managing releases effectively through git
Mohd Farid
 
ODP
Git presentation
Vikas Yaligar
 
PDF
Introduction to Git for Artists
David Newbury
 
PDF
Git for Writers: Dumping the Bucket Metaphor
Mysti Berry
 
PPTX
Introduction To Git Workshop
themystic_ca
 
ODP
How to use git without rage
Javier Lafora Rey
 
PDF
Git-r-Done
Cesar Martinez
 
Git and Testing
Christian Couder
 
JavaScript Community Webinar #14 "Why Is Git Rebase?"
GlobalLogic Ukraine
 
Git github
Anurag Deb
 
Bitbucket
hariprasad1035
 
Git_tutorial.pdf
AliaaTarek5
 
Introduction to git, an efficient distributed version control system
AlbanLevy
 
Version control, you git
Mayur Patil
 
Git for Beginners
Rick Umali
 
Hello git - a soft introduction to git (Talk Slides)
Amity University Noida
 
Git and Github slides.pdf
Tilton2
 
Git and Github workshop ppt slide by slide
RaghavendraVattikuti1
 
Managing releases effectively through git
Mohd Farid
 
Git presentation
Vikas Yaligar
 
Introduction to Git for Artists
David Newbury
 
Git for Writers: Dumping the Bucket Metaphor
Mysti Berry
 
Introduction To Git Workshop
themystic_ca
 
How to use git without rage
Javier Lafora Rey
 
Git-r-Done
Cesar Martinez
 

Recently uploaded (20)

PDF
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Shabista Imam
 
PDF
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
hosseinihamid192023
 
PDF
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
 
PPTX
Comparison of Flexible and Rigid Pavements in Bangladesh
Arifur Rahman
 
PPTX
Introduction to sensing and Week-1.pptx
KNaveenKumarECE
 
PDF
Proposal for folders structure division in projects.pdf
Mohamed Ahmed
 
PPTX
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
PDF
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
 
PDF
Complete University of Calculus :: 2nd edition
Shabista Imam
 
PPTX
Structural Wonderers_new and ancient.pptx
nikopapa113
 
PDF
System design handwritten notes guidance
Shabista Imam
 
PPT
دراسة حاله لقرية تقع في جنوب غرب السودان
محمد قصص فتوتة
 
PPTX
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
 
PPTX
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
PDF
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
 
PDF
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Mark Billinghurst
 
PDF
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
PDF
Rapid Prototyping for XR: Lecture 4 - High Level Prototyping.
Mark Billinghurst
 
PPTX
Deep Learning for Natural Language Processing_FDP on 16 June 2025 MITS.pptx
resming1
 
Tally.ERP 9 at a Glance.book - Tally Solutions .pdf
Shabista Imam
 
Call For Papers - 17th International Conference on Wireless & Mobile Networks...
hosseinihamid192023
 
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
 
Comparison of Flexible and Rigid Pavements in Bangladesh
Arifur Rahman
 
Introduction to sensing and Week-1.pptx
KNaveenKumarECE
 
Proposal for folders structure division in projects.pdf
Mohamed Ahmed
 
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
 
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
 
Complete University of Calculus :: 2nd edition
Shabista Imam
 
Structural Wonderers_new and ancient.pptx
nikopapa113
 
System design handwritten notes guidance
Shabista Imam
 
دراسة حاله لقرية تقع في جنوب غرب السودان
محمد قصص فتوتة
 
Industry 4.o the fourth revolutionWeek-2.pptx
KNaveenKumarECE
 
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
 
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
 
Rapid Prototyping for XR: Lecture 1 Introduction to Prototyping
Mark Billinghurst
 
Rapid Prototyping for XR: Lecture 2 - Low Fidelity Prototyping.
Mark Billinghurst
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
Rapid Prototyping for XR: Lecture 4 - High Level Prototyping.
Mark Billinghurst
 
Deep Learning for Natural Language Processing_FDP on 16 June 2025 MITS.pptx
resming1
 
Ad

Automated debugging with git

  • 1. Automated debugging with git Amit Nijhawan
  • 2. 2 What is git bisect? ● Use binary search to find the commit that introduced a bug.  So what does that mean?
  • 3. 3 Divider Slide The basic git bisect workflow
  • 4. 4 Basic bisect commands: start, bad, good $ git bisect start $ git bisect bad # Current version is bad $ git bisect good
  • 5. 5 How to verify good and bad commit using bisect tool?  First, we need to let git know that we are going to start bisect procedure: git bisect start  Next, we will let git know which commit is bad, if the current commit is bad, you don't have to specify the hash: git bisect bad  Then, we let git know which commit is surely a good one (in this case, it is the Initial commit, we have to specify the hash) git bisect good c1417d3
  • 6. 6  At this point, git start checking and it will let you know how many remaining commits to check and which commit it is checking now (git will choose the commit at the middle of your selected range at the beginning) Bisecting: 2 revisions left to test after this (roughly 1 step) [f6ce7408ad0826436c00eb94b7973a965362bc4c] Add container  Yeah, git automatically checks out the commit Add container. Our job is run our code and let git know if this commit contains bad code or not. In our case, this is a bad commit, so we let it know that it is bad. git bisect bad
  • 7. 7  Yeah, now git knows this commit is bad, so it does not need to check all the commits later than this commit. You have just reduced the search range to a half (binary search) Bisecting: 0 revisions left to test after this (roughly 0 steps) [f258f1ce329e4a9dc29bc28e5b03b94838f50333] Add styles  Let's say that this commit is good, we will run git bisect good
  • 8. 8  Git now is able to conclude which is the first bad commit