Page MenuHomeFreeBSD

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

Authored by emaste on Wed, Jul 1, 2:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 10, 11:23 PM
Unknown Object (File)
Fri, Jul 10, 5:20 PM
Unknown Object (File)
Fri, Jul 10, 9:24 AM
Unknown Object (File)
Fri, Jul 10, 9:17 AM
Unknown Object (File)
Fri, Jul 10, 7:02 AM
Unknown Object (File)
Thu, Jul 9, 6:15 PM
Unknown Object (File)
Thu, Jul 9, 6:09 PM
Unknown Object (File)
Thu, Jul 9, 5:37 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.Wed, Jul 1, 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.Wed, Jul 1, 9:44 PM