From 064e2c0ef4e00e1ca94741174c1733079dff579c Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Mon, 3 Sep 2018 13:08:59 -0700 Subject: [PATCH] filter-repo: add --quiet option Signed-off-by: Elijah Newren --- git-filter-repo | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/git-filter-repo b/git-filter-repo index 1643af7..067d8db 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -1169,6 +1169,10 @@ def get_args(): its output, filter the fast-export stream from stdin.''') + + parser.add_argument('--quiet', action='store_true', + help='''Pass --quiet to other git commands called''') + parser.add_argument('revisions', nargs='*', help='''Branches/tags/refs to rewrite. Special rev-list options, such as --branches, --tags, --all, @@ -1401,12 +1405,13 @@ def run_fast_filter(): raise SystemExit("git update-ref failed; see above") # Nuke the reflogs and repack - if not args.debug: + if not args.quiet and not args.debug: print("Repacking your repo and cleaning out old unneeded objects") + quiet_flags = '--quiet' if args.quiet else '' cleanup_cmds = ['git reflog expire --expire=now --all'.split(), - 'git gc --prune=now'.split()] + 'git gc {} --prune=now'.format(quiet_flags).split()] if not is_bare: - cleanup_cmds.append('git reset --hard'.split()) + cleanup_cmds.append('git reset {} --hard'.format(quiet_flags).split()) for cmd in cleanup_cmds: if args.debug: print("[DEBUG] Running: {}".format(' '.join(cmd)))