Hi, On Wed, 23 Apr 2008, Jeff King wrote: > On Tue, Apr 22, 2008 at 12:51:14PM -0400, Avery Pennarun wrote: > > > Do you think git would benefit from having a generalized version of > > this script? Basically, the user provides a "munge" script on the > > command line, and there's a git-filter-branch mode for auto-munging > > (with a cache) every file in every checkin. Even if it's *only* ever > > used for CRLF, I can imagine this being useful to a lot of people. > > It was easy enough to work up the patch below, which allows > > git filter-branch --blob-filter 'tr a-z A-Z' > > However, it's _still_ horribly slow. You create a quite huge blob-cache, so you are pretty heavy on disk-I/O. Have you tried (as suggested in the man page) to run this on a huge RAM disk? That should blow you away. > Shell script is nice and flexible, but running a tight loop like this is > just painful. I suspect filter-branch in something like perl would be a > lot faster and just as flexible (you could even do it in C, but you'd > probably have to invent a little domain-specific scripting language). I hoped that the rewrite-commits attempt was more than just that: an attempt. So there is a point you could start from, doing things in C. But I doubt that you get any joy: either your language is too limited, or you will get the same problems (fork() overhead) again. > Anyway, here is the patch. I don't know if it is even worth applying, > since it is still painfully slow. I like your patch: Acked-by: Johannes Schindelin <johannes.schindelin@xxxxxx> Ciao, Dscho -- To unsubscribe from this list: 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