mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 18:32:14 +02:00
filter-repo: add --quiet option
Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
parent
e6731225f8
commit
064e2c0ef4
@ -1169,6 +1169,10 @@ def get_args():
|
|||||||
its output, filter the fast-export stream from
|
its output, filter the fast-export stream from
|
||||||
stdin.''')
|
stdin.''')
|
||||||
|
|
||||||
|
|
||||||
|
parser.add_argument('--quiet', action='store_true',
|
||||||
|
help='''Pass --quiet to other git commands called''')
|
||||||
|
|
||||||
parser.add_argument('revisions', nargs='*',
|
parser.add_argument('revisions', nargs='*',
|
||||||
help='''Branches/tags/refs to rewrite. Special rev-list
|
help='''Branches/tags/refs to rewrite. Special rev-list
|
||||||
options, such as --branches, --tags, --all,
|
options, such as --branches, --tags, --all,
|
||||||
@ -1401,12 +1405,13 @@ def run_fast_filter():
|
|||||||
raise SystemExit("git update-ref failed; see above")
|
raise SystemExit("git update-ref failed; see above")
|
||||||
|
|
||||||
# Nuke the reflogs and repack
|
# 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")
|
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(),
|
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:
|
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:
|
for cmd in cleanup_cmds:
|
||||||
if args.debug:
|
if args.debug:
|
||||||
print("[DEBUG] Running: {}".format(' '.join(cmd)))
|
print("[DEBUG] Running: {}".format(' '.join(cmd)))
|
||||||
|
Loading…
Reference in New Issue
Block a user