Page MenuHomeFreeBSD

newvers: tweak uname to be more useful
ClosedPublic

Authored by imp on Jan 25 2021, 8:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 7:52 PM
Unknown Object (File)
Wed, Apr 3, 6:04 PM
Unknown Object (File)
Feb 18 2024, 8:21 AM
Unknown Object (File)
Jan 14 2024, 8:35 PM
Unknown Object (File)
Dec 20 2023, 2:28 AM
Unknown Object (File)
Dec 12 2023, 10:27 AM
Unknown Object (File)
Dec 7 2023, 2:23 PM
Unknown Object (File)
Dec 5 2023, 8:50 AM

Details

Summary

The current uname is branch-cXXXX-gHASH

Three changes to make uname more useful.

  1. Move from using git rev-list --count to git rev-lis --count --first-parent since that gives a better, incrementing number.
  2. Report this count as 'vXXXXX' rather than 'cXXXXX' because c is part of a hash and we've changed the sematnics of XXXXX
  3. Remove g to make HASH cut and pastable.

Diff Detail

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

Event Timeline

imp requested review of this revision.Jan 25 2021, 8:02 PM
imp created this revision.

I'm largely indifferent to the first, but I love deleting the 'g' from the hash.

rgrimes added a subscriber: rgrimes.

Yes please

This revision is now accepted and ready to land.Jan 25 2021, 9:11 PM

Two people in email suggested they didn't like this, people here largely do. I'm going to move forward with a note...

To summarize the objections:

That all sounds good, except the 'v' is a bit odd, normally it implies
a "version" number, which isn't exactly what this is. How about 'n' or
'#' since it's just a count?

I'm agnostic on v vs n. Personally, I'd rather it be branch(version)-hash, but that's a much bigger change to newvers.sh

Followed by

Seconded, sorry for discussing the color of bikeshed, but 'v' is also
not intuitive to me. Since it is still a counter, and we are removing
the 'g' in the second part, cXXXXX-HASH is still distinguishable with
the old cXXXXX-gHASH.
Or, maybe call it gXXXXX-HASH which stands for git commit count XXXXX,
with hash value HASH?

I think that 'n' or 'v' are both fine choices. # I'd like to avoid since we use that for build number. g I think is not so clear a connection than either 'v' or 'n'.

If this were commits since the branch point, I'd lean more towards 'v' instead of 'n' since it's the Xth version of the branch. However, it's a count back to the start of the project, so maybe 'n' is better. Doing a count back to the branch point would be tricky, but possible. However, it adds needless complexity, imho.

I've sent a followup to arch@ and will let things cook for another few hours at leasat.

This revision was automatically updated to reflect the committed changes.