Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59069 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18722 invoked from network); 19 Mar 2012 22:26:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2012 22:26:24 -0000 Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.170 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.212.170 mail-wi0-f170.google.com Received: from [209.85.212.170] ([209.85.212.170:59128] helo=mail-wi0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/86-19822-F82B76F4 for ; Mon, 19 Mar 2012 17:26:23 -0500 Received: by wibhr17 with SMTP id hr17so3994778wib.5 for ; Mon, 19 Mar 2012 15:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7coAvF1+D8/+TswMVe/G9k05uEtaUcRE2RPEmD+c888=; b=yoxudjAZkRoyMrbaHXBo4LFRPKCxBOIhoYhF1WHePT4qWp6LtRerWN5SKP+WW7MO/J QI0C9Rkf/zARJpzjOYcmgF/GMNiwBAdJp7/ek4Uw5KlUCk9IwF0YzP/5IupjmdI38/zC qnKzb4cwTQ71HG/gd59Vp4lghifRcU4YqKlRfKlnv2ZJ0NET5lVW7f0/ANzV+pLzRNP1 zOc0IpyGzVXB7/wZUH0I01/IxA9q2HG1gLX697TeMYwq6tdFlOgkpWRwBblouTuldKjG 3TGGP/cc37byqjc7m0mbO2gmPqqU79LpB80XhPk5UFwJkzgPGG5KwAyz2nzcTmFosajj zaIQ== MIME-Version: 1.0 Received: by 10.180.24.7 with SMTP id q7mr23466748wif.11.1332195979286; Mon, 19 Mar 2012 15:26:19 -0700 (PDT) Received: by 10.223.116.141 with HTTP; Mon, 19 Mar 2012 15:26:19 -0700 (PDT) In-Reply-To: <4F67AE0B.8090508@oracle.com> References: <4F67AE0B.8090508@oracle.com> Date: Mon, 19 Mar 2012 15:26:19 -0700 Message-ID: To: Christopher Jones Cc: PHP Developers Mailing List Content-Type: multipart/alternative; boundary=f46d043892ab1dd92304bba00c01 Subject: Re: [PHP-DEV] php-src is now on git From: kris.craig@gmail.com (Kris Craig) --f46d043892ab1dd92304bba00c01 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Mar 19, 2012 at 3:07 PM, Christopher Jones < christopher.jones@oracle.com> wrote: > > > On 03/19/2012 01:31 PM, Kris Craig wrote: > >> Here's what I wound-up doing: The merge entries on the workflow page now >> contain "--no-ff" and I added an entry to the FAQ about the merge.ff option >> available in newer clients. This way we should be covered either way. =) >> --Kris >> > > Is this supported by the php-src repo? This is what I get after using > --no-ff: > > $ git push origin > To https://git.php.net/**repository/php-src.git > ! [rejected] PHP-5.3 -> PHP-5.3 (non-fast-forward) > ! [rejected] PHP-5.4 -> PHP-5.4 (non-fast-forward) > ! [rejected] master -> master (non-fast-forward) > error: failed to push some refs to 'https://git.php.net/** > repository/php-src.git ' > To prevent you from losing history, non-fast-forward updates were rejected > Merge the remote changes (e.g. 'git pull') before pushing again. See the > 'Note about fast-forwards' section of 'git push --help' for details. > > > -- > Email: christopher.jones@oracle.com > Tel: +1 650 506 8630 > Blog: http://blogs.oracle.com/opal/ > > That error can sometimes be misleading. I've noticed that it typically happens if you're trying to push a branch containing merged commits to a remote version of that branch that is newer than the one your commits were merged into (i.e. you forgot to do a git pull followed by a git rebase before doing the merge). I can't say for certain but that's a likely possibility that that's what happened in your case. Moving forward, we should probably add that to the workflow as it can save a lot of headaches moving forward. Specifically, when merging in a branch: 1. git checkout 2. git pull [destination branch] 3. git checkout 4. git rebase 5. git checkout 6. git merge --no-ff 7. git push origin [destination branch] 8. git branch -d What often happens is that you'll pull a branch then start working on a feature branch. However, while you're doing that, somebody else pushes a newer version of the branch you pulled. If you then merge into the older "revision" of that branch without first making sure it's up-to-date, everything will blow up in your face when you try to do a push. Despite the migraines this tends to cause, it's actually a good thing that it does this. After all, we don't *want* an older version of a branch being dumped on top of a newer version. That would get very ugly lol. The only downside is that the resulting error message when using --no-ff is needlessly confusing for newcomers. Assuming that's what happened in your case, you've got some damage control to do. Whenever I'm training people in the office on using Git and they make this inevitable mistake, I always tell them to think of the damage control as good practice lol. =) Anyway, assuming you haven't yet deleted the original feature branch, this will be really easy: 1. git checkout -b - Creates a backup copy of the outdated branch with the merges. 2. git branch -D - Deletes the corrupted branch. Note that uppercase "-D" is required since this is considered an "unsafe" delete. 3. git checkout -b origin/ - Re-creates the branch you just deleted, this time just grabbing the one currently on the remote origin. 4. git checkout - Checkout the feature branch that you originally merged into the develop branch. 5. git rebase - Your feature branch will now be based off of the current develop branch that you just pulled from the remote origin. 6. git checkout 7. git merge --no-ff - Merge the newly-rebased feature branch into this branch. 8. git push origin [corrupted branch name] - Now your push should be successful. I hope that helps! =) --Kris --f46d043892ab1dd92304bba00c01--