Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bfg fails to strip objects #62

Closed
marscher opened this issue Dec 8, 2014 · 3 comments
Closed

bfg fails to strip objects #62

marscher opened this issue Dec 8, 2014 · 3 comments

Comments

@marscher
Copy link

marscher commented Dec 8, 2014

Trying to cleanup this repo https://bitbucket.org/cmb_fu/stallone.git

eg. bfg -D *.o

after re investigating the biggest blobs, the same ids are still present and are still referenced by something, because git gc --aggressive --prune=now does not remove those blobs.

@marscher
Copy link
Author

marscher commented Dec 8, 2014

btw:

  bfg -B 1 --no-blob-protection

tries to remove the same object over and over, if executed multiple times.

@rtyley
Copy link
Owner

rtyley commented Dec 8, 2014

after re investigating the biggest blobs, the same ids are still present and are still referenced by something, because git gc --aggressive --prune=now does not remove those blobs.

Are you sure that you've followed the BFG usage instructions? In particular, this line seems to be missing in the report you made earlier to the Git mailing list:

git reflog expire --expire=now --all

The Git reflog retains references to 'old' branch positions, so unless you clear the reflog, git gc can't dispose of the referenced junk.

Thanks for providing a link to your repo - I ran the BFG on a copy locally, and git gc seemed to work fine:

$ du -h objects/
15M objects/pack
4.0K    objects/info
15M objects/
$ java -jar bfg-1.11.8.jar -D *.o
...
In total, 216 object ids were changed - a record of these will be written to:

    /tmp/tmp.Yun2EygWIA.bfg-report/2014-12-08/17-14-14/object-id-map.old-new.txt

BFG run is complete!
$ reflog expire --expire=now --all
$ git gc --prune=now --aggressive
Delta compression using up to 4 threads.
Compressing objects: 100% (3670/3670), done.
Writing objects: 100% (3968/3968), done.
Total 3968 (delta 2726), reused 985 (delta 0)
$ du -h objects/
11M objects/pack
8.0K    objects/info
11M objects/

As you can see, the pack size has been reduced by 4MB.

I've pushed the results up to https://github.com/bfg-repo-cleaner-demos/stallone - no problems (or *.o files) that I could see.

@marscher
Copy link
Author

marscher commented Dec 8, 2014

doh :) I just forgot this step. Thanks

@marscher marscher closed this as completed Dec 8, 2014
rtyley added a commit that referenced this issue Dec 9, 2014
Although documented in http://rtyley.github.io/bfg-repo-cleaner/#usage ,
users sometime miss that instruction, eg:

#62

Note that '&&' works on Windows as well as BASH:

http://stackoverflow.com/a/8055430/438886

See also 85d392a7 for
some notes on why we need to clear the reflog.
abaga129 pushed a commit to abaga129/glean that referenced this issue Jul 18, 2019
Although documented in http://rtyley.github.io/bfg-repo-cleaner/#usage ,
users sometime miss that instruction, eg:

rtyley/bfg-repo-cleaner#62

Note that '&&' works on Windows as well as BASH:

http://stackoverflow.com/a/8055430/438886

See also rtyley/bfg-repo-cleaner@85d392a7 for
some notes on why we need to clear the reflog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants