[StGit PATCH 8/9] Add the log --clear option

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

 



This option allows the clearing of the log history which sometimes may
get too large.

Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxxxx>
---
 stgit/commands/log.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/stgit/commands/log.py b/stgit/commands/log.py
index 3370e6c..92aaf0b 100644
--- a/stgit/commands/log.py
+++ b/stgit/commands/log.py
@@ -50,7 +50,9 @@ options = [
     opt('-f', '--full', action = 'store_true',
         short = 'Show the full commit ids'),
     opt('-g', '--graphical', action = 'store_true',
-        short = 'Run gitk instead of printing')]
+        short = 'Run gitk instead of printing'),
+    opt('--clear', action = 'store_true',
+        short = 'Clear the log history')]
 
 directory = common.DirectoryHasRepositoryLib()
 
@@ -76,6 +78,11 @@ def func(parser, options, args):
     except KeyError:
         out.info('Log is empty')
         return
+
+    if options.clear:
+        log.delete_log(stack.repository, stack.name)
+        return
+
     stacklog = log.get_log_entry(stack.repository, logref, logcommit)
     pathlim = [os.path.join('patches', pn) for pn in patches]
 

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]