How to do it...

There are a few things to remember. The script has to be in your path so that Git can use the script. Besides this, only imagination sets the boundaries:

  1. Open your favorite editor and insert the following lines into the file:
#!/bin/bash
NUMBEROFCOMMITS=$(git log --all --oneline | wc -l)while :WHICHCOMMIT=$(( ( RANDOM % $NUMBEROFCOMMITS ) + 1 ))COMMITSUBJECT=$(git log --oneline --all -${WHICHCOMMIT} | tail -n1)COMMITSUBJECT_=$(echo "$COMMITSUBJECT" | cut -b1-60)do    if [ $RANDOM -lt 14000 ]; then         echo "${COMMITSUBJECT_} PASSED"    elif [ $RANDOM -gt 15000 ]; then         echo "${COMMITSUBJECT_} FAILED"    fi done
  1. Save the file with the name git-likeaboss. This is a very simple script that will list random commit subjects with either ...

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.