I really considered that at first (but using a string not a bool), but the function would be littered with if ( $commit == "nocommit" ) all over the place and it seemed better to just make a separate function. The duplication is minuscule.