Remove .git directories from "gems" installed from git sources #76

Closed
danp opened this Issue Mar 21, 2013 · 9 comments

Projects

None yet

5 participants

@danp
Owner
danp commented Mar 21, 2013

ref #16

If I have:

gem "rails", :git => "git://github.com/rails/rails.git", :ref => "3-0-stable"

In my Gemfile I end up with a directory like:

vendor/bundle/ruby/1.9.1/bundler/gems/rails-77403a9b0407

in my slug. This directory contains a .git directory. In a slug created from an app with the above line in its Gemfile that .git directory is 64M. I believe this directory can be removed from the slug and things will still work.

@danp danp added a commit to danp/heroku-buildpack-ruby-minimal that referenced this issue Mar 21, 2013
@danp danp Remove .git directories from git-sourced gems. Ref heroku/heroku-buil… 6c0df97
Owner
danp commented Dec 10, 2013

As a datapoint for this issue, my buildpack has been used with the linked commit for some time without issues seen or reported.

Contributor

Seems good to me. Do you have any idea how long the .git/ folder removal takes?

Owner
danp commented Dec 12, 2013

Near-none in my experience, though I have not measured specifically. I just pushed an app using rails from git and my buildpack and there was no noticeable delay between installing the bundle and "Discovering process types", during which the deletion would have taken place.

Contributor

We should probably do this

Owner
danp commented Feb 27, 2015

👍 I still think this should be safe.

Pinging @schneems. Any news on this?

👍

Contributor
cyx commented Apr 23, 2015

👍 Willing to take a stab on this if we're all good with the idea.

Contributor
schneems commented May 5, 2015

This is deployed

@schneems schneems closed this May 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment