summaryrefslogtreecommitdiffstats
path: root/command.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-18 13:49:13 -0700
committerShawn O. Pearce <sop@google.com>2009-04-18 13:49:13 -0700
commitdb45da12089bf131579d100ff7990cbc18d07325 (patch)
treec81dbff8a644272dc12cfcdc129ee1f0db3a559f /command.py
parent50fa1ac6db388c0aa16751b5ad69d296e5eea047 (diff)
downloadgit-repo-db45da12089bf131579d100ff7990cbc18d07325.tar.gz
Add -p to `repo forall` to improve output formatting
When trying to read log output from many projects at once it can be difficult to make sense of which messages came from where. For many professional developers it is common to want to view the last week's worth of your work, so you can write a weekly summary of your activity for your status report. This is easier with the new -p option: repo forall -pc git log --reverse --since=1.week.ago --author=sop produces a report of all commits written by me in the last week, formatted in a paged output display, with headers inserted in front of each project's output. Where this can be even more useful is with git log's pickaxe, e.g. now we can use: repo forall -pc git log -Sbar v1.0..v1.1 to locate all additions or removals of the symbol 'bar' since v1.0, up to and including v1.1. Before displaying the matching commits in a project, a project header is shown, giving the user some context information for the matching results. Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'command.py')
-rw-r--r--command.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/command.py b/command.py
index c3cad5ea..a941b95a 100644
--- a/command.py
+++ b/command.py
@@ -27,6 +27,9 @@ class Command(object):
27 manifest = None 27 manifest = None
28 _optparse = None 28 _optparse = None
29 29
30 def WantPager(self, opt):
31 return False
32
30 @property 33 @property
31 def OptionParser(self): 34 def OptionParser(self):
32 if self._optparse is None: 35 if self._optparse is None:
@@ -109,11 +112,15 @@ class InteractiveCommand(Command):
109 """Command which requires user interaction on the tty and 112 """Command which requires user interaction on the tty and
110 must not run within a pager, even if the user asks to. 113 must not run within a pager, even if the user asks to.
111 """ 114 """
115 def WantPager(self, opt):
116 return False
112 117
113class PagedCommand(Command): 118class PagedCommand(Command):
114 """Command which defaults to output in a pager, as its 119 """Command which defaults to output in a pager, as its
115 display tends to be larger than one screen full. 120 display tends to be larger than one screen full.
116 """ 121 """
122 def WantPager(self, opt):
123 return True
117 124
118class MirrorSafeCommand(object): 125class MirrorSafeCommand(object):
119 """Command permits itself to run within a mirror, 126 """Command permits itself to run within a mirror,