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@xxxxxxxx> --- 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 - : send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html