In a087cc9819 ("git-gc --auto: protect ourselves from accumulated
cruft", 2007-09-17), the user was warned if there were too many
unreachable loose objects. This made sense at the time, because gc
couldn't prune them safely. But subsequently, git prune learned the
ability to not prune recently created loose objects, making pruning able
to be done more safely, and gc was made to automatically prune old
unreachable loose objects in 25ee9731c1 ("gc: call "prune --expire
2.weeks.ago" by default", 2008-03-12).

This makes the warning unactionable by the user, as any loose objects
left are not deleted yet because of safety, and "git prune" is not a
command that the user is recommended to run directly anyway.

Therefore, remove this warning.

Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
This was noticed when a daemonized gc run wrote this warning to the log
file, and returned 0; but a subsequent run merely read the log file, saw
that it is non-empty and returned -1 (which is inconsistent in that such
a run should return 0, as it did the first time).
---
 builtin/gc.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/builtin/gc.c b/builtin/gc.c
index ccfb1ceaeb..fc3b553651 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -641,10 +641,6 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
        if (pack_garbage.nr > 0)
                clean_pack_garbage();
 
-       if (auto_gc && too_many_loose_objects())
-               warning(_("There are too many unreachable loose objects; "
-                       "run 'git prune' to remove them."));
-
        if (!daemonized)
                unlink(git_path("gc.log"));
 
-- 
2.18.0.203.gfac676dfb9-goog

Reply via email to