mirror of
https://github.com/Dev-Wiki/git-repo.git
synced 2025-12-13 16:14:02 +08:00
status: add -q/--quiet option
The --quiet option reduces the output to just
a list of projects with modified workspaces (and
orphans if -o is specified)
A common use case is when performing a full-workspace
merge. The integrator will kick-off a merge via:
repo forall -c git merge <some tag>
And then produce a short list of conflicted projects via:
repo status -q
The integrator can then iteratively fix and clean up all conficted
components. The merge is complete when:
repo status -q
returns no output.
Change-Id: Ibbba8713eac35befd8287c95948874e23fd5c7e2
This commit is contained in:
@@ -911,11 +911,13 @@ class Project(object):
|
||||
else:
|
||||
return False
|
||||
|
||||
def PrintWorkTreeStatus(self, output_redir=None):
|
||||
def PrintWorkTreeStatus(self, output_redir=None, quiet=False):
|
||||
"""Prints the status of the repository to stdout.
|
||||
|
||||
Args:
|
||||
output: If specified, redirect the output to this object.
|
||||
quiet: If True then only print the project name. Do not print
|
||||
the modified files, branch name, etc.
|
||||
"""
|
||||
if not os.path.isdir(self.worktree):
|
||||
if output_redir is None:
|
||||
@@ -941,6 +943,10 @@ class Project(object):
|
||||
out.redirect(output_redir)
|
||||
out.project('project %-40s', self.relpath + '/ ')
|
||||
|
||||
if quiet:
|
||||
out.nl()
|
||||
return 'DIRTY'
|
||||
|
||||
branch = self.CurrentBranch
|
||||
if branch is None:
|
||||
out.nobranch('(*** NO BRANCH ***)')
|
||||
|
||||
Reference in New Issue
Block a user