Skip to content

Include git commit information in $&version #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jpco
Copy link
Collaborator

@jpco jpco commented Mar 1, 2025

This is a relatively small change.

; ./es.old -c 'echo <=$&version'
es version 0.9.2 2-Mar-2022
; ./es.new -c 'echo <=$&version'
v0.9.2-248-gc7c3c42 2025-03-01

Version information is now generated automatically by the mkversion script which calls git describe --tags and git show --format=%ci.

Breaking it down to most atomic units of user-visible change:

  1. Changes version format from $&version from 0.9.2 to v0.9.2 (this is just based on how git output is formatted)
  2. Changes date format from $&version from 2-Mar-2022 to 2022-03-02 (also just based on git output formatting)
  3. Removes the es version prefix from $&version
  4. Splits version output from $&version into two separate terms, one for version string and one for commit date
  5. For an es built from a non-tagged commit, changes the output from v0.9.2 to v0.9.2-(number of commits since tag)-g(commit id).

As a last piece, this changes the last line of initial.es to use the new $&version and remove the calls to date and pwd which upset reproducible-build systems like Nix.

The main point of this PR is to add the commit info, so that $&version produces output more specific than today's "built sometime in the last 3 years". I think the old setup made a lot more sense in the '90s style of development without version control, and I think this setup makes more sense now. The other changes are basically just aesthetic.

Fixes #147. This is semi-cribbed from the setup that rc has, so I guess this is also related to #1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request: Include git commit in $&version return value
1 participant