[phobos] bad git usage?

Brad Roberts braddr at puremagic.com
Sat May 14 18:09:20 PDT 2011


On 5/14/2011 5:59 PM, Michel Fortin wrote:
> Le 2011-05-14 à 20:26, Brad Roberts a écrit :
> 
>> I don't know who's done what to piss off git, but 2 builds in the last 4 days have failed due to bad interactions with
>> github.  The auto-tester maintains a pristine tree that it just pulls into each cycle to get current code.  It _should_
>> be a simple fast-forward merge update every single time.  But twice it hasn't been:
>>
>> Just now:
>>
>> From git://github.com/D-Programming-Language/phobos
>> + d30bfde...c5cd017 HEAD       -> origin/HEAD  (forced update)
>> error: Ref refs/remotes/origin/master is at c5cd017921bb78644f8d130dc19c0df9e5b03bb5 but expected
>> d30bfdea40e768519aaa77170ee9e9697cbf685e
>> ! d30bfde..fc5f620  master     -> origin/master  (unable to update local ref)
>>
>> The last time:
>>
>> From git://github.com/D-Programming-Language/phobos
>> + b64d9f2...c5cd017 HEAD       -> origin/HEAD  (forced update)
>> error: Ref refs/remotes/origin/master is at c5cd017921bb78644f8d130dc19c0df9e5b03bb5 but expected
>> b64d9f27c23dec08865d9eb624bf0d22b18e5637
>> ! b64d9f2..d30bfde  master     -> origin/master  (unable to update local ref)
>>
>> It looks like HEAD and master are out of sync, and from what I understand, that shouldn't happen.
>>
>> The problematic commit:
>>   https://github.com/D-Programming-Language/phobos/commit/c5cd017921bb78644f8d130dc19c0df9e5b03bb5
>>
>> But I'm not sure what's problematic about it.
>>
>> Thoughts?
> 
> Generally this kind of message happen when someone pushed a history rewrite (pushing a commit that is not a child of the existing commit, which requires the push command to have a -f (force) switch).
> 
> Now, perhaps the autotester should do a "git reset --hard origin/master" instead of doing a pull (which implicitly does a merge). It would avoid this kind of issue, although it's still not a very good thing to rewrite history in a public repository.
> 

I went to each auto-tester and did:

  git reset --hard origin/master
  git pull origin

That seems to have brought them all up to the current commit.  We'll see if the problem crops up again.

Looking at the phobos network on github, I see that HEAD is specifically tagged to a specific, non-most-recent, commit,
and is listed as a branch.  Neither druntime nor dmd have those properties.


More information about the phobos mailing list