Include explicit git commit hash in config.h#1175
Include explicit git commit hash in config.h#1175ischoegl wants to merge 3 commits intoCantera:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1175 +/- ##
==========================================
- Coverage 65.35% 65.23% -0.12%
==========================================
Files 315 315
Lines 45999 45999
Branches 19531 19531
==========================================
- Hits 30062 30007 -55
Misses 13445 13445
- Partials 2492 2547 +55
Continue to review full report at Codecov.
|
|
Also eliminated |
| std::string gitCommit() | ||
| { | ||
| #ifdef GIT_COMMIT | ||
| return GIT_COMMIT; | ||
| #else | ||
| return "unknown"; | ||
| #endif | ||
| } | ||
|
|
There was a problem hiding this comment.
Why not keep this function around? It can still use the macro from config.h, but keeping this would save a lot of the other churn here, I think.
There was a problem hiding this comment.
The reason for eliminating this was to ensure that both CANTERA_VERSION and CANTERA_GIT_COMMIT are handled the same. It probably should be deprecated though ... (Edit: done)
f145d42 to
988e08c
Compare
This change ensures that CANTERA_GIT_COMMIT is accessed in a similar way as CANTERA_VERSION. Cantera::gitCommit is deprecated.
988e08c to
e841f1b
Compare
|
The current approach is used for a reason -- this way, each time you make a local git commit, rebuilding Cantera only requires recompiling Printing out the discovered git commit somewhere near the start of the build process isn't a bad idea, though. |
Makes a lot of sense (in hindsight 😂)! Closing this as much of the work here is rendered moot. |
Changes proposed in this pull request
During compilation, the git commit hash is currently passed through the commandline:
which is, however, hard to locate. As an example, the git hash for the last successful build for #1174 would have been much easier to find.
The proposed change adds a
CANTERA_GIT_COMMITto the configuration summary, e.g.Checklist
scons build&scons test) and unit tests address code coverage