From: Nicolas Pitre <nico@cam.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH 1/5] prune-packed: don't call display_progress() for every file
Date: Tue, 30 Oct 2007 14:57:31 -0400 [thread overview]
Message-ID: <1193770655-20492-2-git-send-email-nico@cam.org> (raw)
In-Reply-To: <1193770655-20492-1-git-send-email-nico@cam.org>
The progress count is per fanout directory, so it is useless to call
it for every file as the count doesn't change that often.
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
builtin-prune-packed.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/builtin-prune-packed.c b/builtin-prune-packed.c
index 015c8bb..907e368 100644
--- a/builtin-prune-packed.c
+++ b/builtin-prune-packed.c
@@ -15,6 +15,9 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len, int opts)
struct dirent *de;
char hex[40];
+ if (opts == VERBOSE)
+ display_progress(&progress, i + 1);
+
sprintf(hex, "%02x", i);
while ((de = readdir(dir)) != NULL) {
unsigned char sha1[20];
@@ -26,8 +29,6 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len, int opts)
if (!has_sha1_pack(sha1, NULL))
continue;
memcpy(pathname + len, de->d_name, 38);
- if (opts == VERBOSE)
- display_progress(&progress, i + 1);
if (opts & DRY_RUN)
printf("rm -f %s\n", pathname);
else if (unlink(pathname) < 0)
--
1.5.3.4.1463.gf79ad2
next prev parent reply other threads:[~2007-10-30 18:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 18:57 [PATCH 0/5] more progress display stuff Nicolas Pitre
2007-10-30 18:57 ` Nicolas Pitre [this message]
2007-10-30 18:57 ` [PATCH 2/5] make struct progress an opaque type Nicolas Pitre
2007-10-30 18:57 ` [PATCH 3/5] relax usage of the progress API Nicolas Pitre
2007-10-30 18:57 ` [PATCH 4/5] add throughput to progress display Nicolas Pitre
2007-10-30 18:57 ` [PATCH 5/5] add throughput display to index-pack Nicolas Pitre
2007-10-30 19:41 ` [PATCH 6/5] add some copyright notice to the progress display code Nicolas Pitre
2007-10-30 21:06 ` [PATCH 7/5] add throughput display to git-push Nicolas Pitre
2007-10-31 0:05 ` [PATCH 2/5] make struct progress an opaque type Junio C Hamano
2007-11-01 2:58 ` [PATCH 1/5] prune-packed: don't call display_progress() for every file Shawn O. Pearce
2007-11-01 12:06 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1193770655-20492-2-git-send-email-nico@cam.org \
--to=nico@cam.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).