Skip to content
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

Parameterize 'dev' string in pre-release tag (OR allow free formatting?) #45

Open
needleshaped opened this issue Oct 7, 2024 · 0 comments

Comments

@needleshaped
Copy link

needleshaped commented Oct 7, 2024

Dear @mdomke, thank you for the tool!

Please consider allowing more flexible formatting of the output string.

  1. Use case: I usually add a branch name to version, and our developers use short dev branch name, instead of develop. Thus, end result is often confusing 1.0.0.dev.1-ce117b4b-dev (using - instead of + because Docker tags are not compatible with semver).
  2. Use case: When explaining to developers as DevOps engineer new proposed versioning scheme based on your project, I often need to mention, that .dev = number of commits since the last commit, which is not self-evident. I would either completeley remove it, or replace with .commit, which would make it self-evident.

I'd like to avoid post-string-replacement (s/.dev/.commit/), thus asking you here.

Essentially it means a new variable for this line


P.S. This may be solved, with making format itself configurable. As of now, you have hardcoded choice of formats.

  • Existing tool that implements it this way, is e.g. date, date +%Y%m%d-%H:%M:%S,
  • This would result in usage: git-semver -format '%X.%Y.%Z-dev.%N+%S'. (%S - SHA)

Such method would also allow other functionality to be easily added, e.g.

  • like branch name %B, while preserving default format intact
  • or making generated version compatible with Docker tags out of the box.
  • will allow to use user-defined $VARIABLES in a format string, which opens complete freedom, without a need of post-processing.
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

No branches or pull requests

1 participant