AUTOREVISION(1) | AUTOREVISION(1) |
NAME¶
autorevision - extract current-revision metadata from version-control repositories
SYNOPSIS¶
autorevision -t <output-type> [-o <cache-file> [-f] ] [-e <name>] [-U] [-C <path>] [-q]
autorevision -s <symbol> [-o <cache-file> [-f] ] [-e <name>] [-U] [-C <path>] [-q]
autorevision -V
DESCRIPTION¶
Extracts metadata about the head revision from your repository.
This program is meant to be used by project build systems to extract properties that can be used in version strings. It can emit source files containing variable and macro definitions suitable for use with C, C++, Java, Mac info.plist, sh, Python, Perl and many other types of files (see below for the full list).
The generated source is written to the standard output.
This program can normally be called from anywhere within a repository copy. Under bzr the copy must be of a branch, not a full multibranch repository. Under Subversion it must be called under a repository checkout, not the repository itself.
If you specify a cache file, then when autorevision is run where no repository can be recognized, the values from the cache file will be used instead. If a repository can be recognized, the cache is rewritten. This feature makes it possible for your build to run from an unpacked tarball that includes the cache file.
Valid Repository Types¶
Git: A version greater than 1.7.2.3 is recommended.
Mercurial: A version greater than 1.6 is recommended.
Subversion: Any production version.
Bazaar: Any production version.
Valid Output Types¶
clojure
c
autorevision_declr.h in the contribs dir is provided for use with this output.
cmake
csharp
h
hpp
ini
java
javaprop
js
json
lua
m4
matlab
octave
php
pl
py
rpm
scheme
sed
sh
swift
Unless set VCS_EXTRA and any symbols that are missing because of repository support are set to nil.
tex
xcode
Valid Symbol Names¶
VCS_TYPE
VCS_BASENAME
VCS_NUM
VCS_UUID
For git we choose the oldest commit if there is more than one.
Not currently implemented for bzr.
VCS_DATE
VCS_BRANCH
Under git, this will normally be the shortname of the current branch (the asterisked line in the output of "git branch") except that when the branch doesn’t have a shortname it will be a full refspec.
Under hg the feature that is called branches is actually a sort of graph coloring (multiple heads can have the same branch name) so this symbol is filled with the current bookmark if it exists, with the current branch name as a fallback.
Under Subversion this will normally be either trunk or the basename of some branch or tag subdirectory, depending on where autoversion was run.
Under bzr, this is the nick of the branch you are on.
VCS_TAG
Empty under Subversion.
VCS_TAG_OPENPGP
Blank if the current tag is not signed or if no tags exist.
Currently only implemented for git.
VCS_TICK
Empty under Subversion.
VCS_EXTRA
Additionally, the name of this symbol may be customized as well. (See -e for more info.)
VCS_ACTION_STAMP
For svn the second part is simply the author name.
Not currently implemented for bzr.
VCS_FULL_HASH
VCS_COMMIT_OPENPGP
Blank if the current revision is not signed.
Currently only implemented for git.
VCS_SHORT_HASH
VCS_WC_MODIFIED
Untracked files are not ignored; see -U for details.
OPTIONS¶
-t <output-type>
-s <symbol>
-o <cache-file>
-e <name>
-f
-U
-C <path>
-q
-V
BUGS¶
The bzr extractor is not very well tested.
When a git repo is actually a git-svn remote, this tool tries to do the right thing and return a Subversion revision. The bug is that the detector code for this case is somewhat unreliable; you will get the hash instead if your configuration doesn’t use svn-remote.svn.url.
Nested repositories, particularly repositories of different types, may result in incorrect and unintended behavior.
Unpacking a tarball into a repository will result in incorrect and unintended behavior.
NOTES¶
Development of autorevision is carried out at https://github.com/Autorevision/autorevision
HTML rendered docs and usage examples can be found at https://autorevision.github.io/
AUTHORS¶
dak180 <dak180@users.sf.net>: concept, bash/C/C++/XCode/PHP/ini support, git and hg extraction. Eric S. Raymond <esr@thyrsus.com>: Python/Perl/lua/m4 support, svn and bzr extraction, git-svn support, CLI design, man page. See AUTHORS.txt for a full list in order of number of contributions.
2021-01-25 | 1.22 |