summaryrefslogtreecommitdiffstats
path: root/main.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 /main.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 'main.py')
-rwxr-xr-xmain.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.py b/main.py
index 740fb3a6..6fa1e51b 100755
--- a/main.py
+++ b/main.py
@@ -105,6 +105,8 @@ class _Repo(object):
105 % name 105 % name
106 sys.exit(1) 106 sys.exit(1)
107 107
108 copts, cargs = cmd.OptionParser.parse_args(argv)
109
108 if not gopts.no_pager and not isinstance(cmd, InteractiveCommand): 110 if not gopts.no_pager and not isinstance(cmd, InteractiveCommand):
109 config = cmd.manifest.globalConfig 111 config = cmd.manifest.globalConfig
110 if gopts.pager: 112 if gopts.pager:
@@ -112,11 +114,10 @@ class _Repo(object):
112 else: 114 else:
113 use_pager = config.GetBoolean('pager.%s' % name) 115 use_pager = config.GetBoolean('pager.%s' % name)
114 if use_pager is None: 116 if use_pager is None:
115 use_pager = isinstance(cmd, PagedCommand) 117 use_pager = cmd.WantPager(copts)
116 if use_pager: 118 if use_pager:
117 RunPager(config) 119 RunPager(config)
118 120
119 copts, cargs = cmd.OptionParser.parse_args(argv)
120 try: 121 try:
121 cmd.Execute(copts, cargs) 122 cmd.Execute(copts, cargs)
122 except ManifestInvalidRevisionError, e: 123 except ManifestInvalidRevisionError, e: