Re: filter-branch performance
- From
Jeff King <peff@peff.net>
- Date
- Dec 10, 2014, 14:37 UTC
- Message-ID
- <20141210143706.GA2996@peff.net>
- In-Reply-To
- <CAFY1edYYC9TZmLE6b3=QAoTB1zQHi_Y97rHL-5wk5Pbpa_oj_w@mail.gmail.com>
On Wed, Dec 10, 2014 at 02:18:24PM +0000, Roberto Tyley wrote:
Show 15 quoted lines
> Depending on how much time you can sink into improving the performance
> (versus just allowing the process to run to completion), you could
> also look into a non-forking solution, as well as not bothering to
> load the commit trees. To me non-forking means putting everything into
> the JVM by using JGit, like the BFG does, though libgit2 might also be
> an option.
>
> Changing the BFG's code to do the transformation in your script is
> absolutely trivial - define a commit-node cleaner like this:
>
> object SetCommitterToAuthor extends CommitNodeCleaner {
> override def fixer(kit: CommitNodeCleaner.Kit) = c =>
> c.copy(committer = c.author) // PersonIdent class holds name, email &
> time
> }Thanks. I _almost_ mentioned BFG in the original email, but I didn't think it could do arbitrary fixes like this. Can you monkey-patch in arbitrary code, or do you have to rebuild all of BFG to include the snippet above?
> ...trivial if you don't mind compiling Scala with SBT that is, and I'm > sure some people do! A DSL for non-Scala people to define their own > BFG scripts would be good, I must get on that some day.
That would be cool. Even if the DSL was just Java, if you could do something like:
vi fix.java javac fix.java bfg --filter=fix.class
that would be very useful (and I am probably showing my lack of Java chops by getting the compilation command or filenames wrong :) ).
> I started running the same test some time ago using filter-branch, > unfortunately that test has not completed yet - the BFG appears to be > substantially faster.
No fair if you didn't run filter-branch on a PC and BFG on a Raspberry Pi. You have to give us a fighting chance. :)
-Peff