[chef] Re: Re: Re: Re: How to push to upstream cookbook-vendor branch?


Chronological Thread 
  • From: Bryan Berry < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: How to push to upstream cookbook-vendor branch?
  • Date: Mon, 17 Oct 2011 07:17:15 +0200

thanks Eric, I will try this out.

Do you think that it would be best to make yumrepo a separate github repo as Adam and Noah seem to suggest?

Back to my original mail. Do you think that my corp-epel would be useful to other sysadmins? And do you think a data bag "urls" is the best way to access that repo?

On Sun, Oct 16, 2011 at 9:49 PM, Eric G. Wolfe < "> > wrote:
You don't have to fork a whole copy of each user's fork of cookbooks to collaborate on community cookbooks, however.  An easy way to do this, is set up a remote for the user you want to fetch from, add a tracking branch, push your changes back to your own origin, and finally do a pull request.  It may be a little confusing but its not as hard as it sounds.

First go find the user's cookbook repo you want to fork, there you can find the read-only git link for that user's fork.  Since you brought up my yumrepo branch earlier on the mailing list, I'll use that as an example here.  Assuming you already have a local clone of your own opscode/cookbooks fork, then you can go into your local repository and manipulate a branch to point

# Add a remote named "apenguin"
1) git remote add apenguin git://github.com/atomic-penguin/cookbooks.git

# Fetch all the tags and branches from the user's upstream cookbook repo.
2) git fetch apenguin

# Add a local tracking branch for apenguin/yumrepo branch
3) git branch --track yumrepo apenguin/yumrepo

# Switch to your newly tracked local branch.  Do a pull to update your local tracking branch.
4) git checkout yumrepo; git pull yumrepo

# Make change, stage change, commit change
5) git add .; git commit -m "Making changes"

# Push change to a new branch on your own fork of opscode/cookbooks.  Assuming your own remote is "origin".
6) git push origin yumrepo:yumrepo

At which point you can proceed to do a pull request through the github Web UI.
Eric G. Wolfe
Senior Linux Administrator,
IT Infrastructure Systems
--------------------------------------
Marshall University Computing Services
Drinko Library 428-K
One John Marshall Dr.
Huntington, WV 25755
Phone: 304.696.3428
Email: 
 
 " target="_blank">
 

Civilization is the limitless multiplication of unnecessary necessities.
		-- Mark Twain

On 10/15/2011 03:21 PM, Bryan Berry wrote:
damn, i was hoping that 1) i misunderstood u on irc and 2) there was magic that I was missing :(

On Sat, Oct 15, 2011 at 9:19 PM, Noah Kantrowitz < " target="_blank"> > wrote:

On Oct 15, 2011, at 11:42 AM, Bryan Berry wrote:

> I am trying to figure out how to "vendor branch" technique to push my changes upstream cookbook.
>
> Here is the workflow that I have in mind
> $ knife cookbook site install <cookbook>
> $ vim cookbooks/<cookbook>  #make changes
> $ git checkout <cookbook>-vendor
> $ git checkout master path/to/modified-cookbook
> $ git commit -am 'merging select files into vendor-branch'
>
> However, when I  do  $ git checkout chef-<cookbook>-vendor && git ls-files
> git seems to be tracking everything in this branch, not just the files for the cookbook.
>
> I have read through http://wiki.opscode.com/display/chef/Working+with+Git+and+Cookbooks, but it still isn't clear to me how to push my changes to the upstream cookbook. Perhaps I am missing something completely obvious. Can someone enlighten me?
>
> The only other alternative I see is to track down the source of cookbook, fork it, create a patch from my code, apply it to my fork, send a pull request.

As I explained on IRC, that is indeed the way to do it. The management in the cookbook repo is purely as an installed artifact right now.

--Noah
-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAk6Z3LIACgkQA9fEp2eRsU/9uQCg71c3GrXSTO3X0dgzUUvrD9qF
If4AoJdpH43XifeRWWcLn0F+x4nlmpBe
=22IR
-----END PGP SIGNATURE-----






Archive powered by MHonArc 2.6.16.

§