OpenMPCD
include
OpenMPCD
getGitCommitIdentifier.hpp
Go to the documentation of this file.
1
/**
2
* @file
3
* Declares the `OpenMPCD::getGitCommitIdentifier` function.
4
*/
5
6
#ifndef OPENMPCD_GETGITCOMMITIDENTIFIER_HPP
7
#define OPENMPCD_GETGITCOMMITIDENTIFIER_HPP
8
9
#include <string>
10
11
namespace
OpenMPCD
12
{
13
/**
14
* Returns a string identifying the current git commit of the source code.
15
*
16
* The returned string constist of the current git commit hash,
17
* plus the string `+MODIFICATIONS` if tracked files have been modified,
18
* but not yet commited,
19
* plus the string `+UNTRACKED` if there are any files that are neither
20
* tracked nor ignored.
21
*
22
* The returned string is automatically updated if `make` is run from the
23
* git repository, or if any of the `copy` scripts in the `tools` directory
24
* is run from the git repository.
25
*
26
* Returns an empty string if the `git` command cannot be executed,
27
* or if no commit hash could be found (e.g. because there is no git
28
* repository).
29
*
30
* @throw OpenMPCD::Exception Throws if the output of the `git` command
31
* could not be read.
32
*/
33
const
std::string
getGitCommitIdentifier
();
34
}
35
36
#endif
OpenMPCD::getGitCommitIdentifier
const std::string getGitCommitIdentifier()
Returns a string identifying the current git commit of the source code.
Generated by
1.8.17