Change 32707

mark_zinthefer (Mark Zinthefer)
Mark Zinthefer committed this change into //guest/perforce_software/sdp/dev/Server/Unix/p4/common/bin
Request Review
Download .zip
Bug hunt with Claude

Justification:

p4sanity_check.sh � Typo in error message causes silent false-positive

grep -q '^info: Change' "$CmdLog" ||\
   errmsg "No changelists detecgted in the output."

"detecgted" is a typo, but more importantly the grep pattern '^info: Change' is brittle � p4 -s changes prefixes each output line with info:, but the pattern is anchored to the beginning of the line and relies on the exact tagged output format. If output format varies (e.g. warnings, server messages prepend), this check silently passes when it shouldn't. The typo itself won't cause a runtime failure but indicates the error path is undertested.

Claude went on to suggest the following to make the grep more robust. I haven't made this change but here is the suggestion:

grep -qE '^info: Change [0-9]+ on [0-9]{4}/[0-9]{2}/[0-9]{2}' "$CmdLog" ||\
   errmsg "No changelists detected in the output."
  • Files 1
  • Comments 0
1 edited 0 added 0 deleted
p4sanity_check.sh#5
Loading...
Tip: Use n and p to cycle through the changes.