Skip to content

Conversation

@RaymiiOrg
Copy link
Collaborator

I'm not sure how you feel about including a version number, here's a quick demo with cmake and git, included in the
main output (if no args are given). It might be suitable until actual versions/releases are managed.

Here's example output:

[21:35:59] [remy@gateway] [ ~/tmp/axpbox/build (git_version_info_in_usage_output) ]
$ ./axpbox 
AXPBox Alpha Emulator
Git version info: SHA1: 6ef090e610f2a154e11b645c8f72a3dbeb3fe3bd; Date: Sat Nov 7 21:34:46 2020; Commit subject: Add git version info to usage output. Includes commit hash, commit date and commit subject.
Usage: ./axpbox run|configure <options>

No substitute for an actual version number, but does give users information about which build they're running. Now that so many improvements are happening, it will probably help with bug reports in the future, if it's known which version is being used.

Copy link
Owner

@lenticularis39 lenticularis39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is certainly a good idea considering more and more people are discovering AXPbox, therefore using it and stumbling upon various bugs.

The version message is too long in my opinion, I suppose something like this would suffice:

AXPBox Alpha Emulator (commit d1b81289593412bfe4b61c87e550451ec2693f0b)
Usage: ./axpbox run|configure <options>

One can always look up the commit message and so on in the commit history if needed.

About the implementation: the GITINFO variable could be included in config.h.in among the PACKAGE_ variables (which are currently unused if I'm correct - they were carried over from es40). I believe there is no need to have other variables inside the config header and this one directly on the command line.

…it info output shorter, only include commit hash.
@RaymiiOrg
Copy link
Collaborator Author

The version message is too long in my opinion, I suppose something like this would suffice:

AXPBox Alpha Emulator (commit d1b81289593412bfe4b61c87e550451ec2693f0b)
Usage: ./axpbox run|configure <options>

Changed it to be just the hash.

About the implementation: the GITINFO variable could be included in config.h.in among the PACKAGE_ variables (which are currently unused if I'm correct - they were carried over from es40). I believe there is no need to have other variables inside the config header and this one directly on the command line.

Was not aware of what a cmakedefine does, but that is nicer indeed. Updated the code to use them.

Copy link
Owner

@lenticularis39 lenticularis39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for the changes :)

@lenticularis39 lenticularis39 merged commit 0893ddf into lenticularis39:main Nov 9, 2020
@RaymiiOrg RaymiiOrg deleted the git_version_info_in_usage_output branch November 17, 2020 14:28
RaymiiOrg pushed a commit to RaymiiOrg/axpbox that referenced this pull request Nov 17, 2020
…in_usage_output

Add git version info to usage output.
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.

2 participants