[PATCH 2/9] lib/bpgit.py: add git describe --dirty support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Luis R. Rodriguez" <mcgrof@xxxxxxxxxxxxxxxx>

git describe --dirty pegs a "-dirty" at the end of
your tag if you haven't properly commited things.
When the the --dirty flag is used assume the current
state of the tree.

We will use this later.

Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx>
---
 lib/bpgit.py |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/bpgit.py b/lib/bpgit.py
index 142b9b5..40523f2 100644
--- a/lib/bpgit.py
+++ b/lib/bpgit.py
@@ -27,13 +27,15 @@ def rev_parse(rev='HEAD', tree=None):
         raise SHAError()
     return sha
 
-def describe(rev='HEAD', tree=None, get_long=False):
+def describe(rev='HEAD', tree=None, get_long=False, dirty=False):
     cmd = ['git', 'describe', '--always']
 
     if (get_long):
         cmd.append('--long')
-
-    cmd.append(rev)
+    if (dirty):
+        cmd.append('--dirty')
+    else:
+        cmd.append(rev)
 
     process = subprocess.Popen(cmd,
                                stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
-- 
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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux