1.10 @
The -t option dow defaults to a build timestamp.
+ In a git repo, the -b option now defaults to `git describe HEAD`.
1.9 @ 2013-05-23
The -v option now preserves the build log for diagnostic purposes.
#
# By Eric S. Raymond, May 2012. BSD terms apply.
#
-import os, sys, ConfigParser, getopt, tempfile, shutil, datetime
+import os, sys, ConfigParser, getopt, tempfile, shutil, datetime, commands
version = "1.9"
+def commit_id():
+ "If we're in a repository directory, try to extract a commit description."
+ if os.path.exists(".git"):
+ (status, output) = commands.getstatusoutput("git describe HEAD")
+ if status == 0:
+ return output
+ return None
+
if __name__ == '__main__':
name = email = project = token = url = None
# Deduce what project and directory to operate on (and go there).
noexec = False
verbose = False
- build_version = None
+ build_version = commit_id()
description = datetime.datetime.now().isoformat()
(opts, args) = getopt.getopt(sys.argv[1:], "b:nt:v")
for (opt, arg) in opts:
<para>The <option>-b</option> option specifies an arbitrary build
version to associate with the submission. A repository commit level
-would be a good thing to use for this.</para>
+would be a good thing to use for this. If coverity-submit is run
+at the top level of a version-control repository, the build version may
+default to a description of the head commit; presently this feature
+is supported for git only.</para>
<para>The <option>-t</option> option specifies an arbitrary project
tag or description to associate with the submission. This text is