Re: filter-branch performance
- From
Roberto Tyley <roberto.tyley@gmail.com>
- Date
- Dec 10, 2014, 15:25 UTC
- Message-ID
- <CAFY1edZqt-VY7afBjhtzQV6QW0zS8Cbd09XJbNZ9bj+T6GWOGg@mail.gmail.com>
- In-Reply-To
- <20141210143706.GA2996@peff.net>
On 10 December 2014 at 14:37, Jeff King <peff@peff.net> wrote:
Show 11 quoted lines
> On Wed, Dec 10, 2014 at 02:18:24PM +0000, Roberto Tyley wrote:
>> 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?Well, I publish a bfg-library jar to Maven Central, so you don't need to rebuild that:
http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22bfg-library_2.11%22
...in principle you can write a Java/Groovy/whatever project that calls that jar (your entry point would be com.madgag.git.bfg.cleaner.RepoRewriter) - tho' to be honest, I can't swear to how /friendly/ the API would be to call from non-Scala-land though, as I haven't tried it.
Incidentally, if people want to try compiling this monkey-patched BFG at home, this is how you'd do it:
* Install SBT - http://www.scala-sbt.org/download.html (or 'brew install sbt' for Mac OS X) * git clone https://github.com/rtyley/bfg-repo-cleaner.git --branch set-committer-to-author * cd bfg-repo-cleaner * sbt "bfg/run --no-blob-protection"
There will be a lot of automated downloading of dependencies, and compilation will be slow the first time around, but at least there aren't that many steps. I do realise that being Scala/JVM based makes working on the BFG a bit of a specialist activity at the moment!
Show 12 quoted lines
>> 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 :) ).
Your syntax is right :) I'll give it some thought.
Show 6 quoted lines
>> 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. :)
I guess I made that rod for my own back :) http://youtu.be/Ir4IHzPhJuI for those who haven't seen it.