From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Cc: pasky@suse.cz
Subject: [PATCH] Avoid slowness when timewarping large trees.
Date: Sat, 25 Mar 2006 04:39:57 -0500 [thread overview]
Message-ID: <20060325093957.GA27832@coredump.intra.peff.net> (raw)
In-Reply-To: <20060325093641.GA26284@coredump.intra.peff.net>
tree_timewarp was calling read, egrep, and rm in an O(N) loop where N is
the number of changed files between two trees. This caused a bottleneck
when seeking/switching/merging between trees with many changed files.
Signed-off-by: Jeff King <peff@peff.net>
---
This is a repost of the initial patch featuring a few cleanups suggested
by Junio.
cg-Xlib | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
5f79b37a0eb85ff4f643e70a7f2823e68e9d9ca4
diff --git a/cg-Xlib b/cg-Xlib
index 5896df7..1a9bd4f 100644
--- a/cg-Xlib
+++ b/cg-Xlib
@@ -363,12 +363,9 @@ tree_timewarp()
# Kill gone files
git-diff-tree -r "$base" "$branch" |
- while IFS=$'\t' read header file; do
- # match ":100755 000000 14d43b1abf... 000000000... D"
- if echo "$header" | egrep "^:([^ ][^ ]* ){4}D" >/dev/null; then
- rm -- "$file"
- fi
- done
+ # match ":100755 000000 14d43b1abf... 000000000... D"
+ sed -ne 's/^:[^\t]* D\t//p' |
+ xargs rm -f --
git-checkout-index -u -f -a
# FIXME: Can produce bogus "contains only garbage" messages.
--
1.2.4
next prev parent reply other threads:[~2006-03-25 9:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-24 8:44 [PATCH] cogito: Avoid slowness when timewarping large trees Jeff King
2006-03-24 10:21 ` Junio C Hamano
2006-03-24 10:55 ` Jeff King
2006-03-24 11:01 ` Junio C Hamano
2006-03-24 11:22 ` Jeff King
2006-03-24 16:43 ` Shawn Pearce
2006-03-25 9:36 ` Jeff King
2006-03-25 9:39 ` Jeff King [this message]
2006-03-26 18:05 ` [PATCH] " Petr Baudis
2006-03-25 19:55 ` [PATCH] cogito: " Junio C Hamano
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=20060325093957.GA27832@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=pasky@suse.cz \
/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).