Any court or judge authorized to grant the writ, to whom a petition therefor is presented, must endorse upon the petition the hour and date of its presentation and the hour and date of the granting or denial of the writ, and must, if it appear that the writ ought to issue, grant the same without delay; and if the person by or upon whose behalf the application for the writ is made be detained upon a criminal charge, may admit him to bail, if the offense is bailable, pending the determination of the proceeding.
Ca. Pen. Code § 1476