diff --git a/Documentation/cmd-gc.txt b/Documentation/cmd-gc.txt index a890f1be49..b7388a1555 100644 --- a/Documentation/cmd-gc.txt +++ b/Documentation/cmd-gc.txt @@ -8,6 +8,7 @@ gerrit gc - Run the Git garbage collection 'ssh' -p 'gerrit gc' [--all] [--show-progress] + [--aggressive] ... -- @@ -44,6 +45,9 @@ This command is intended to be used in scripts. --show-progress:: If specified progress information is shown. +--aggressive:: + If an aggressive garbage collection should be done. + == EXAMPLES Run the Git garbage collection for the projects 'myProject' and diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/GarbageCollectionCommand.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/GarbageCollectionCommand.java index c533f4f4ed..d02fb4cd2c 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/GarbageCollectionCommand.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/GarbageCollectionCommand.java @@ -46,6 +46,9 @@ public class GarbageCollectionCommand extends SshCommand { @Option(name = "--show-progress", usage = "progress information is shown") private boolean showProgress; + @Option(name = "--aggressive", usage = "run aggressive garbage collection") + private boolean aggressive; + @Argument(index = 0, required = false, multiValued = true, metaVar = "NAME", usage = "projects for which the Git garbage collection should be run") private List projects = new ArrayList<>(); @@ -85,7 +88,8 @@ public class GarbageCollectionCommand extends SshCommand { } GarbageCollectionResult result = - garbageCollectionFactory.create().run(projectNames, showProgress ? stdout : null); + garbageCollectionFactory.create().run(projectNames, aggressive, + showProgress ? stdout : null); if (result.hasErrors()) { for (GarbageCollectionResult.Error e : result.getErrors()) { String msg;