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
F171624327: D57995.id181251.diff
Sat, Sep 12, 6:33 AM
Unknown Object (File)
Fri, Sep 11, 2:40 PM
Unknown Object (File)
Fri, Sep 11, 2:02 PM
Unknown Object (File)
Thu, Sep 10, 6:31 PM
Unknown Object (File)
Wed, Sep 9, 2:21 PM
Unknown Object (File)
Mon, Sep 7, 9:33 PM
Unknown Object (File)
Sun, Sep 6, 2:30 PM
Unknown Object (File)
Sat, Sep 5, 1:46 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