From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: backports@vger.kernel.org
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Subject: [PATCH 1/9] lib/bpgit.py: make git describe --long optional
Date: Wed, 22 May 2013 04:34:30 -0700 [thread overview]
Message-ID: <1369222478-30577-2-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1369222478-30577-1-git-send-email-mcgrof@do-not-panic.com>
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
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@do-not-panic.com>
---
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
next prev parent reply other threads:[~2013-05-22 11:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 11:34 [PATCH 0/9] backports: add kernel uploading support Luis R. Rodriguez
2013-05-22 11:34 ` Luis R. Rodriguez [this message]
2013-05-22 12:02 ` [PATCH 1/9] lib/bpgit.py: make git describe --long optional Johannes Berg
2013-05-22 21:49 ` Luis R. Rodriguez
2013-05-22 11:34 ` [PATCH 2/9] lib/bpgit.py: add git describe --dirty support Luis R. Rodriguez
2013-05-22 11:34 ` [PATCH 3/9] lib/bpgit.py: add git status support Luis R. Rodriguez
2013-05-22 12:02 ` Johannes Berg
2013-05-23 0:28 ` Luis R. Rodriguez
2013-05-22 11:34 ` [PATCH 4/9] lib/bpgit.py: add git clean support Luis R. Rodriguez
2013-05-22 12:03 ` Johannes Berg
2013-05-23 0:28 ` Luis R. Rodriguez
2013-05-22 11:34 ` [PATCH 5/9] lib/bpgit.py: add git tree verification support Luis R. Rodriguez
2013-05-22 11:34 ` [PATCH 6/9] lib/bpgit.py: add support for git paranoia Luis R. Rodriguez
2013-05-22 12:05 ` Johannes Berg
2013-05-23 0:37 ` Luis R. Rodriguez
2013-05-23 15:25 ` Johannes Berg
2013-05-23 21:02 ` Luis R. Rodriguez
2013-05-28 20:02 ` Luis R. Rodriguez
2013-05-28 20:14 ` Luis R. Rodriguez
2013-05-28 20:23 ` Johannes Berg
2013-07-27 17:11 ` Luis R. Rodriguez
2013-05-28 20:17 ` Johannes Berg
2013-05-22 11:34 ` [PATCH 7/9] lib/bpgpg.py: add simple gpg helpers for --armor --detach-sign Luis R. Rodriguez
2013-05-22 11:34 ` [PATCH 8/9] lib/bpkup.py: add or own kernel uploader helper lib Luis R. Rodriguez
2013-05-22 12:06 ` Johannes Berg
2013-05-23 0:43 ` Luis R. Rodriguez
2013-05-22 11:34 ` [PATCH 9/9] gentree.py: add kernel upload support Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1369222478-30577-2-git-send-email-mcgrof@do-not-panic.com \
--to=mcgrof@do-not-panic.com \
--cc=backports@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox