Git Product home page Git Product logo

Comments (6)

rtyley avatar rtyley commented on May 22, 2024

Hi @zhangpy, thanks for sharing this issue with me. Can you tell me which version of The BFG you're using, and are you able to share this repo with me?

from bfg-repo-cleaner.

rtyley avatar rtyley commented on May 22, 2024

Can you also give the full command line invocation you used? Were you using --protect-blobs-from?

from bfg-repo-cleaner.

zhangpy avatar zhangpy commented on May 22, 2024

I use version 1.11.6 on ubuntu 14.04-64bit
I tested Java8(oracle 1.8.0_05) and Java7(1.7.0_55-b13)
I am very sorry, I can't share the repo because it's company project.

bfg = java -jar bfg.jar
my command is

cd test.git
bfg -b 10M

I don't use parameter -p.
I tested the parameter and the error message is same.
Please let me know if you need more info.

from bfg-repo-cleaner.

warrenseine avatar warrenseine commented on May 22, 2024

I've had the same issue using --protect-blobs-from, but realised the branches weren't checked out first. Once I checked out the branches, the error disappeared.

from bfg-repo-cleaner.

mumrah avatar mumrah commented on May 22, 2024

I'm seeing a similar NPE when using the protect option: here was my command

java -jar ~/Downloads/bfg-1.11.8.jar -b 1M -p HEAD~10 Fusion.git

Is that the correct syntax for -p?

from bfg-repo-cleaner.

rtyley avatar rtyley commented on May 22, 2024

java -jar /Downloads/bfg-1.11.8.jar -b 1M -p HEAD10 Fusion.git

The HEAD~10 syntax is valid, and works so long as that commit actually exists in your repo - ie if there actually are 10 commits in the history of your current branch. I've personally tried this on repo, and it works.

However, if there are less than 10 commits in that particular history- ie HEAD~10 does not exist, which you can can test by executing git show HEAD~10 - then the BFG does indeed crash, with an ugly exception stacktrace like this:

[error] (run-main-5) java.lang.NullPointerException
java.lang.NullPointerException
    at org.eclipse.jgit.lib.ObjectIdOwnerMap.get(ObjectIdOwnerMap.java:131)
    at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:807)
    at com.madgag.git.package$RichObjectId.asRevObject(package.scala:190)
    at com.madgag.git.bfg.cleaner.protection.ProtectedObjectCensus$$anonfun$3.apply(ProtectedObjectCensus.scala:66)

...so, sorry the clarity sucks there, but could you verify that that commit actually exists?

Out of curiosity - why have you chosen to protect the contents of an old commit, rather than your current commit?

from bfg-repo-cleaner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.