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

Optimize git resource for fixed revision #182

Merged
merged 1 commit into from
Dec 9, 2015

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Dec 8, 2015

git fetch origin can be very slow. For example,

$ git remote -v
origin  github.com:rbenv/rbenv (fetch)
origin  github.com:rbenv/rbenv (push)
$ time git fetch origin
git fetch origin  0.02s user 0.02s system 0% cpu 3.285 total

So I want to skip git fetch origin if HEAD is the same as specified revision.
With this change, following recipe execution time is optimized from 4.14s to 1.20s.

git "/Users/takashi-kokubun/.rbenv" do
  repository "git://github.com/rbenv/rbenv.git"
  revision "20755cfc153dd0bf802524cbb313f834a59c0f30"
end

ryotarai added a commit that referenced this pull request Dec 9, 2015
Optimize git resource for fixed revision
@ryotarai ryotarai merged commit dd2a3aa into itamae-kitchen:master Dec 9, 2015
@k0kubun k0kubun deleted the faster-git branch December 9, 2015 07:12
k0kubun added a commit to k0kubun/itamae that referenced this pull request Dec 29, 2015
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

Successfully merging this pull request may close these issues.

2 participants