summaryrefslogtreecommitdiff
path: root/builtin/prune.c
diff options
context:
space:
mode:
authorBrandon Casey <drafnel@gmail.com>2012-08-07 05:01:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-08-07 22:01:37 (GMT)
commit90b29cb7a8213a947e08c41ea4680ced7ac7c67c (patch)
treee5ca471ce0bdc904253ac38da61b26d730565405 /builtin/prune.c
parente15c16de396a1e1f42001b03cb885ce64eb4098e (diff)
downloadgit-90b29cb7a8213a947e08c41ea4680ced7ac7c67c.zip
git-90b29cb7a8213a947e08c41ea4680ced7ac7c67c.tar.gz
git-90b29cb7a8213a947e08c41ea4680ced7ac7c67c.tar.bz2
prune.c: only print informational message in show_only or verbose mode
"git prune" reports removal of loose object files that are no longer necessary only under the "-v" option, but unconditionally reports removal of temporary files that are no longer needed. The original thinking was that the presence of a leftover temporary file should be an unusual occurrence that may indicate an earlier failure of some sort, and the user may want to be reminded of it. Removing an unnecessary loose object file, on the other hand, is just part of the normal operation. That is why the former is always printed out and the latter only when -v is used. But neither report is particularly useful. Hide both of these behind the "-v" option for consistency. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/prune.c')
-rw-r--r--builtin/prune.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/prune.c b/builtin/prune.c
index b99b635..6cb9944 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -25,7 +25,8 @@ static int prune_tmp_object(const char *path, const char *filename)
return error("Could not stat '%s'", fullpath);
if (st.st_mtime > expire)
return 0;
- printf("Removing stale temporary file %s\n", fullpath);
+ if (show_only || verbose)
+ printf("Removing stale temporary file %s\n", fullpath);
if (!show_only)
unlink_or_warn(fullpath);
return 0;