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, Nov 3, 11:39 PM
Unknown Object (File)
Oct 16 2024, 5:44 AM
Unknown Object (File)
Oct 15 2024, 8:28 AM
Unknown Object (File)
Oct 13 2024, 5:23 PM
Unknown Object (File)
Oct 12 2024, 10:29 PM
Unknown Object (File)
Oct 12 2024, 5:27 PM
Unknown Object (File)
Oct 11 2024, 8:31 AM
Unknown Object (File)
Oct 9 2024, 9:44 PM

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.