Currently, Clipper relies solely on Git tags to determine the version displayed using the -v flag. While this works well for production builds, it's not ideal for development environments where the codebase might not always be tagged.
This enhancement aims to provide a more informative and user-friendly approach to version management.
Proposed Changes:
Development Version:
Introduce a default "dev" version string (e.g., "v0.0.0-dev") that is displayed when the code is run directly without being built (e.g., go run main.go).
Consider appending a timestamp or commit hash to the "dev" version for precise track of development builds.
Build Version:
During the build process, continue using Git tags to determine the version if available.
If no tag is found, use a fallback version string (e.g., "v0.0.0-unreleased") to indicate that the build is not associated with a specific release.
Display Logic:
Refactor the code to conditionally display the appropriate version based on whether the tool is running from a built binary or in development mode.
Goals:
Clarity: Provide clear and distinct version information to users, differentiating between development and production builds.
Flexibility: Allow developers to easily identify the specific version of the code they are running during development.
Maintainability: Make version management more robust and adaptable to different workflows.
Additional Considerations:
Configuration: Explore options to allow users to customize the development version string or override the default behavior.
Version Format: Decide on a standardized format for development versions (e.g., vX.Y.Z-dev+timestamp) to ensure consistency.
Currently, Clipper relies solely on Git tags to determine the version displayed using the
-v
flag. While this works well for production builds, it's not ideal for development environments where the codebase might not always be tagged.This enhancement aims to provide a more informative and user-friendly approach to version management.
Proposed Changes:
go run main.go
).Goals:
Additional Considerations:
vX.Y.Z-dev+timestamp
) to ensure consistency.