[chef] Re: Re: Re: git resource branch vs revision vs reference


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: Re: git resource branch vs revision vs reference
  • Date: Mon, 10 Sep 2012 09:38:28 -0700


On Monday, September 10, 2012 at 8:38 AM, Jesse Campbell wrote:

So what am I getting when I specify "HEAD", and how is that different
from specifying "master" ?
It was reverting to an old commit when I used "master", and when I
switched over to HEAD it pulled the latest...
or will it only download HEAD or master once, do I need to get in the
habit of always specifying an SHA for it to actually update each time?

$ git ls-remote origin
8413dcd5b4fb91206f5d86c55bb3b67fc43509e2 HEAD
ba13b94837b48851543f383ec61bcc8ba08a2b98 refs/heads/atl_prod
8413dcd5b4fb91206f5d86c55bb3b67fc43509e2 refs/heads/master
ba13b94837b48851543f383ec61bcc8ba08a2b98 refs/pull/1/head
98780812f695c3f1fda6e6dbfdc398153a7042ef refs/pull/1/merge
HEAD is the tip of the current branch. Example from my clone of the Chef source:

chef git:(master)> git rev-parse HEAD
722bc99041b03aaf98c099ee46e14f724cc33018
chef git:(master)> git co 10-stable
Switched to branch '10-stable'
chef git:(10-stable)> git rev-parse HEAD
a77c5ae6dd24af6c06035fb3df0284b8a4a9c265

My understanding is that HEAD on a github repo will simply be the newest commit on whatever branch is the default, usually master.

As for the behavior you're describing, the git provider should always put you on the latest revision of a branch. You need to look at the debug logs to see what's going on. If it's putting you on the wrong revision, that's a bug.
 

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§