[phobos] bad git usage?

Jonathan M Davis jmdavisProg at gmx.com
Sat May 14 18:24:28 PDT 2011


On 2011-05-14 17:59, 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/c5cd017921bb786
> >   44f8d130dc19c0df9e5b03bb5
> > 
> > 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.

It's extremely _bad_ to rewrite the history in a public repository. I've done 
it for my personal branches, and at least some of the time that sort of thing 
should be okay, since they're generally intended for pull requests and 
probably aren't being pulled by other people very often, but when you're 
dealing with an official repository for a project which who knows how many 
people are pulling from, you should never rewrite history without a _very_ 
good reason. The auto tester shouldn't have to be doing a hard reset to 
function properly. Now, that may be necessary to get it back in a valid state 
to continue forward, but a pull should always be sufficient to get the latest 
update from the master repository.

- Jonathan M Davis


More information about the phobos mailing list