Skip to content

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 0.9.2 to v0.9.2 (this is just based on how git output is formatted)
  2. Changes date format from 2-Mar-2022 to 2022-03-02 (also just based on git output formatting)
  3. Removes the es version prefix
  4. Splits the return value 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 return value 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.

jpco added a commit to jpco/es-shell that referenced this pull request Jun 21, 2025
@jpco jpco force-pushed the master branch 3 times, most recently from 64361a8 to a23a7a0 Compare September 19, 2025 00:40
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