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

Add the option to shallow clones with git #114

Merged
merged 1 commit into from
Jan 7, 2014

Conversation

freyes
Copy link

@freyes freyes commented Jan 6, 2014

The new parameter used to indicate that you want a shallow clone is :depth

This is particularly useful for big repositories or trying to clone over slow connections, I'm dealing with both problems at the moment.

Another scenario where this functionality comes handy is when you're testing puppet recipes inside vagrant, for big repos this will speed up your jobs.

@freyes
Copy link
Author

freyes commented Jan 6, 2014

@niedbalski , you can, here is a usage example:

  vcsrepo { "/home/foo/bar":
    ensure => present,
    user => "www-data",
    group => "www-data",
    owner => "www-data",
    provider => "git",
    source => "git@localhost:bar.git",
    force => true,
    depth => "1"  # number of commits to clone, parameter passed `--depth` while cloning
  }

@@ -313,6 +316,7 @@ def git_with_identity(*args)
return ret
end
elsif @resource.value(:user)
notice "git #{args.join(' ')}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this notice left in accidently?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@apenney yes, I missed it while I cleaned my debugging message, I just updated the commit to remove it. Thanks for notice it.

@sodabrew
Copy link

sodabrew commented Jan 6, 2014

+1 this is awesome.

@igalic
Copy link

igalic commented Jan 7, 2014

Who can fix the bundler issue on travis?

@sodabrew
Copy link

sodabrew commented Jan 7, 2014

Rebase onto just-fixed master.

The new parameter used to indicate that you want a shallow clone is `:depth`
@freyes
Copy link
Author

freyes commented Jan 7, 2014

Done, pushed commit after rebase it

sodabrew added a commit that referenced this pull request Jan 7, 2014
Add the option to shallow clones with git
@sodabrew sodabrew merged commit 7ac3464 into puppetlabs:master Jan 7, 2014
@freyes
Copy link
Author

freyes commented Jan 7, 2014

@sodabrew thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants