cb-geo / mpm

CB-Geo High-Performance Material Point Method
https://www.cb-geo.com/research/mpm
Other
235 stars 82 forks source link

Feature/print_git_revision #707

Closed SchDvr closed 3 years ago

SchDvr commented 3 years ago

PR description Add the feature discussed here: the last git SHA1 is printed when a simulation starts. Here is an example of the first line that CB-Geo displays with these changes :

[2021-02-19 10:34:20.894] [main] [info] git revision: e4c44e702eca1d5ecb667573a60fee852a119357

Additional context This changes use Andrew Hardin's project that was developed for this purpose.

SchDvr commented 3 years ago

The build fails because of the clang-format:

  1. in include/git.cc.in the clang-format script puts a space in the middle of some variables that begin and end with the @ character. This makes the generation of include/git.cc fail.
  2. even when these spaces are manually removed, some automatically generated lines in include/git.cc get too long and are no longer respecting the clang-format.

Is there a way to make the clang-format script behave differently for these files?

kks32 commented 3 years ago

Hi @SchDvr I pushed some changes to your repo, this removes git.cc because it will get automatically generated when building so there is no need to add this everytime. So I have ignored it by doing include/git.cc in .gitignore. Also added a flag to turn-off format checking on this file. Hopefully, this should fix all the build issues. Thanks for your contribution!

codecov[bot] commented 3 years ago

Codecov Report

Merging #707 (4c93b20) into develop (6c6578a) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #707   +/-   ##
========================================
  Coverage    96.78%   96.78%           
========================================
  Files          130      130           
  Lines        25882    25882           
========================================
  Hits         25048    25048           
  Misses         834      834           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6c6578a...4c93b20. Read the comment docs.

jgiven100 commented 3 years ago

@SchDvr and @kks32

Thanks all for working on these improvements

SchDvr commented 3 years ago

Thanks for solving the clang-format problem and for merging the branch.