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
F171215374: D57995.id.diff
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
Unknown Object (File)
Fri, Sep 4, 1:19 AM
Unknown Object (File)
Thu, Sep 3, 11:32 PM
Unknown Object (File)
Thu, Sep 3, 10:02 PM
Unknown Object (File)
Thu, Sep 3, 5: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