Skip to content

Compute the uncrustify version - #1069

Merged
gmaurel merged 3 commits into
uncrustify:masterfrom
guy-maurel:ComputeUncrustifyVersion
Mar 29, 2017
Merged

gmaurel merged 3 commits into
uncrustify:masterfrom
guy-maurel:ComputeUncrustifyVersion

Conversation

@guy-maurel

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread CMakeLists.txt Outdated
endif()
set(PACKAGE_VERSION "${full_version}")
set(FULL_VERSION "undefined")
set(PACKAGE_VERSION "undefined")

@CDanU CDanU Mar 25, 2017 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have looked at this, the make_version.py and git describe a bit more and come to the conclusion that this approach is problematic.

Something is going wrong when the else branch is triggered, and I personally would rather prefer to throw an error message there which aborts everything:

message(FATAL_ERROR "message to display" ...)

FATAL_ERROR = CMake Error, stop processing and generation

   than having someone out there with an undefined Uncrustify version.

Dropping the --long inside make_version.py` in:

git describe --long --always --dirty

   would produce short version strings for tagged commits (releases) and long version strings on non tagged commits:

release: uncrustify-0.64
current: uncrustify-0.64-511-gde474b8c

I would prefer to always have this amount of minimal information. If we only need that, we maybe could drop the make_version.py file altogether, assuming that we don't need to also manage hg. As far as I am aware there is no official hg repository of Uncrustify, right?

Contrary to this idea (removing the make_version.py file) would be to do the version string processing entirely in that file. This would:

  • get rid of the #ifdef DEBUG checks
  • create the possibility to add a _d postfix to uncrustify to differentiate between debug and non debug builds
  • allow to remove the g prefix from the commit hash
    (it is there to differentiate between different SCM systems, g = git)

release: uncrustify_d-0.64
current: uncrustify_d-0.64-511-de474b8c

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment.
My idea is to get some more informations from the user who create an issue message
and join the file created by the -p option.

@gmaurel
gmaurel merged commit c2e0d7b into uncrustify:master Mar 29, 2017
@guy-maurel
guy-maurel deleted the ComputeUncrustifyVersion branch December 13, 2017 17:24
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.

3 participants