DEV Community

Discussion on: What are your UNIX pipeline commands that saved you from lot of coding/time?

Collapse
 
0xcafebabe profile image
Wolfgang Werner

I use this pattern to find out the last commit that for which a certain condition was true, e.g. in which something wasn't yet broken.

In this example, test.sh just returns a non-zero code to mimic the condition you want to check for, but this could be anything that can be tested in a shell conditional.

until ./test.sh; do git checkout HEAD~1; done;
Collapse
 
tuomotanskanen profile image
Tuomo Tanskanen

If you have a binary test such as tesh.sh in your example, use git bisect to find faulty commit faster.