If a source and destination files are supplied, GitWCRev copies source to destination, performing keyword substitution as follows:
Table 3.3. List of available keywords
|$WCREV$||Replaced with the HEAD commit revision in the working tree.|
|$WCREV=n$||Replaced with the HEAD commit revision in the working tree, trimmed to |
|$WCBRANCH$||Replaced with the name of the current branch (or SHA-1 if HEAD is detached) of the working tree.|
|$WCLOGCOUNT$, $WCLOGCOUNT&$, $WCLOGCOUNT+$, $WCLOGCOUNT-$||Replaced with the number of first-parent commits from HEAD back to the first commit. This number is guaranteed to increase with every commit on the very same branch as long no history is rewritten and can be used as part of a version number (see https://gcc.gnu.org/ml/gcc/2015-08/msg00148.html and https://gitlab.com/tortoisegit/tortoisegit/merge_requests/1 for more details). The |
|$WCDATE$, $WCDATEUTC$||Replaced with the commit date/time of the highest commit revision. By default, international format is used: |
|$WCNOW$, $WCNOWUTC$||Replaced with the current system date/time. This can be used to indicate the build time. Time formatting can be used as described for |
GitWCRev does not directly support nesting of expressions, so for example you cannot use an expression like:
#define SVN_REVISION "$WCUNVER?$WCNOW$:$WCDATE$$"
But you can usually work around it by other means, for example:
#define DATE_NOW $WCNOW$ #define DATE_COMMIT $WCDATE$ #define DATE "$WCUNVER?DATE_NOW:DATE_COMMIT$"
Some of these keywords apply to single files rather than to an entire working tree, so it only makes sense to use these when GitWCRev is called to scan a single file. This applies to