Sec. 4. When a defendant who has been sentenced to imprisonment in the Texas Department of Criminal Justice has spent time in jail pending trial and sentence or pending appeal, the judge of the sentencing court shall direct the sheriff to attach to the commitment papers a statement assessing the defendant's conduct while in jail.
Sec. 5. Except as otherwise provided by Article 42A.106(b), the court after pronouncing the sentence shall inform the defendant of the defendant's right to petition the court for an order of nondisclosure of criminal history record information under Subchapter E-1, Chapter 411, Government Code, unless the defendant is ineligible to pursue that right because of the requirements that apply to obtaining the order in the defendant's circumstances, such as:
(1) the nature of the offense for which the defendant is convicted; or
(2) the defendant's criminal history.