From: "Luis R. Rodriguez" <mcgrof@xxxxxxxxxxxxxxxx> When calling git describe through our Python library the long option is always used. Make this optional but keep the existing behaviour. This will be used later without the long option and using an argument saves us from having to parse it. We need to use get_long over long given that long is a Python type. Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx> --- gentree.py | 5 +++-- lib/bpgit.py | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gentree.py b/gentree.py index 86b3f3c..f25db52 100755 --- a/gentree.py +++ b/gentree.py @@ -447,9 +447,10 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None, backports_version = "(see git)" kernel_version = "(see git)" else: - backports_version = git.describe(tree=source_dir) + backports_version = git.describe(tree=source_dir, get_long=True) kernel_version = git.describe(rev=args.git_revision or 'HEAD', - tree=args.kerneldir) + tree=args.kerneldir, + get_long=True) f = open(os.path.join(args.outdir, 'versions'), 'w') f.write('BACKPORTS_VERSION="%s"\n' % backports_version) f.write('BACKPORTED_KERNEL_VERSION="%s"\n' % kernel_version) diff --git a/lib/bpgit.py b/lib/bpgit.py index 31b7de3..142b9b5 100644 --- a/lib/bpgit.py +++ b/lib/bpgit.py @@ -27,8 +27,15 @@ def rev_parse(rev='HEAD', tree=None): raise SHAError() return sha -def describe(rev='HEAD', tree=None): - process = subprocess.Popen(['git', 'describe', '--always', '--long', rev], +def describe(rev='HEAD', tree=None, get_long=False): + cmd = ['git', 'describe', '--always'] + + if (get_long): + cmd.append('--long') + + cmd.append(rev) + + process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True, universal_newlines=True, cwd=tree) stdout = process.communicate()[0] -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe backports" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html