Page MenuHomeFreeBSD

newvers.sh: Avoid spurious -dirty in git revision
ClosedPublic

Authored by emaste on Jul 1 2026, 2:38 PM.
Tags
None
Referenced Files
F165743804: D57995.diff
Sun, Aug 9, 3:02 PM
F165721966: D57995.id181251.diff
Sun, Aug 9, 12:03 PM
F165624772: D57995.id181180.diff
Sat, Aug 8, 8:42 PM
Unknown Object (File)
Sat, Aug 8, 3:34 PM
Unknown Object (File)
Sat, Aug 8, 1:32 PM
Unknown Object (File)
Sat, Aug 8, 12:34 PM
Unknown Object (File)
Sat, Aug 8, 9:25 AM
Unknown Object (File)
Fri, Aug 7, 5:21 PM
Subscribers

Details

Summary
If git is installed and .git exists but git rev-parse failed to report a
hash we previously produced just "-dirty" as the git revision.  Gate the
git commit count and -dirty check on the rev-parse passing.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste requested review of this revision.Jul 1 2026, 2:38 PM
emaste created this revision.

jhb might have some views here too.

This is fine by me.
So, if git-rev-parse(1) fails, we just silently ignore it? Maybe erroring in the else branch is too aggressive.

This revision is now accepted and ready to land.Jul 1 2026, 9:44 PM