robotology / ycm-cmake-modules

YCM (YCM CMake modules) is a collection of various useful CMake modules.
http://robotology.github.io/ycm-cmake-modules
Other
52 stars 23 forks source link

Remove check for git user.name and user.email to be set? #455

Open traversaro opened 3 months ago

traversaro commented 3 months ago

In YCMEPHelper in https://github.com/robotology/ycm-cmake-modules/blob/d5c16deed3bf65538d48bebf127c4dcb50a48d8f/modules/YCMEPHelper.cmake#L320-L336 (and hence in any ycm-based superbuild that uses git, so basically all of them) there is some code that checks if the git user.name and user.email is set, and if they are not set, raise a fatal error.

This hit (at least me) many times when trying to run the superbuild on vanilla (Docker, GitHub Actions, gitpod, etc etc) machine, and I am afraid that many other users have been affected as well.

As far as I can understand, the only reason why such check is there is to prevent users to actually commit commits with the automatically generated values for user.name and user.email, i.e. creating warnings such as:

Your name and e-mail address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

however, it does not seems to be that have an hard failure whenever somebody is trying to run the superbuild in a clean environment is worth avoiding in some remote case some autogenerated commit metadata.

So, my plan is to remove this check in the next 0.17.0 release of YCM. The idea is to remove the check rather then just do some sort of tick-tock deprecation cycle, as far as I understand, nothing can break if we remove this check.