Return-Path: X-Original-To: apmail-asterixdb-dev-archive@minotaur.apache.org Delivered-To: apmail-asterixdb-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 837B2187E7 for ; Thu, 24 Sep 2015 01:30:20 +0000 (UTC) Received: (qmail 43963 invoked by uid 500); 24 Sep 2015 01:30:20 -0000 Delivered-To: apmail-asterixdb-dev-archive@asterixdb.apache.org Received: (qmail 43912 invoked by uid 500); 24 Sep 2015 01:30:20 -0000 Mailing-List: contact dev-help@asterixdb.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.incubator.apache.org Delivered-To: mailing list dev@asterixdb.incubator.apache.org Received: (qmail 43900 invoked by uid 99); 24 Sep 2015 01:30:20 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Sep 2015 01:30:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AE8E9C1248 for ; Thu, 24 Sep 2015 01:30:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.899 X-Spam-Level: ** X-Spam-Status: No, score=2.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id vtUrRUtWbFHT for ; Thu, 24 Sep 2015 01:30:12 +0000 (UTC) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id C523E21141 for ; Thu, 24 Sep 2015 01:30:11 +0000 (UTC) Received: by iofb144 with SMTP id b144so61992304iof.1 for ; Wed, 23 Sep 2015 18:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=XTXnB5BAdbQZU25aOKeRW59z5y9lYY0Q+d2EJHlC6Qc=; b=pUzaA/Jr1ejKnyYGdREro/8ehidrQfcMRjXLQGZ1k/BgQvwfuAeeQvRIgo44QTg4mW GUBSNsH3ihDKi0DxBcSPuTz5j0z7cmp+S2PYmqQ7yXli/CAPwyLTDcNinlLqHZ4pKoDa BZqy8MZ18CknlpsW+JkjyI2I6wFuKqv8dNLfznVaTII6DdlwCKuFFeA/1D/7MDto/RnL 3rUqra3gxXBKPG9hUWaXyGDM5uy2ZmCBqP1cOauoDFbphi77kz3oPTUzjncgmjYfbBuz BcKjtl6w0XwszwCMuyx3yNRzrXhNtlzV7o4QJt1RbFcf6Zm7k8mMbvPUCIN34OJfcrvb yeNg== X-Received: by 10.107.154.213 with SMTP id c204mr41989100ioe.80.1443058210624; Wed, 23 Sep 2015 18:30:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.41.170 with HTTP; Wed, 23 Sep 2015 18:29:41 -0700 (PDT) In-Reply-To: References: <920C6B5B-B0E8-4F3A-AC9E-5DC8FEECC18D@gmail.com> From: Ted Dunning Date: Wed, 23 Sep 2015 18:29:41 -0700 Message-ID: Subject: Re: Merging vs. squashing To: dev@asterixdb.incubator.apache.org Cc: Chris Hillery , Jianfeng Jia Content-Type: multipart/alternative; boundary=001a1140fdea08e0840520742c92 --001a1140fdea08e0840520742c92 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable My experience or knowledge is hardly comprehensive, but merging branches has most of the benefit of squash commits while retaining history. Cherry picking (in my experience) works very much as desired. The fact that a commit exists on two branches doesn't seem to cause any trouble at all at merge time. The flexibility is fairly awesome. I would imagine that there are counter examples where subsequent changes make the merge complex and I have no idea what the limits are. All I can say is that in the few years I have been working with git, I have been astounded at how well the complex fringes work. Rebasing interactively is another case. I routinely use this to make my local history more sensible. Within reason, it allows me to squash and re-order my own commits so that there appears to be more order in the historical record than was in my head at the time I did the work. On Wed, Sep 23, 2015 at 6:01 PM, Till Westmann wrote: > I=E2=80=99m certainly not an expert on git as I never took the time (or n= eeded) to > dive deeply into it. > > Reading this thread it seems to me that we have a number of reasonable > wishes what we would like to do (e.g. squash commits to get a readable > history for the master branch, cherry-pick between branches to avoid > duplicate work, =E2=80=A6) but it seems that there=E2=80=99s no obvious w= ay to achieve all > of them. > > If that=E2=80=99s indeed the case, we=E2=80=99d have to decide which wish= is more > important and I think that different people will have different opinions = on > this. Since I=E2=80=99m a big fan of readable history (and seeing the res= ult of a > code review in the master history as opposed to a number of intermediate > steps), I=E2=80=99m pretty happy with the current state of the world. > > Given the problem of having a subset of code that could benefit 2 branche= s > I would try to separate it out, review and merge it to master, and to mer= ge > master back into the 2 branches. However, I see that this could be a lot = of > work and there could be reasons why is is not feasible. > > Just my 2c (to have more people chiming in :) ) > Till > > On 23 Sep 2015, at 15:38, Chris Hillery wrote: > > P.S. I'd love it if anyone else with opinions or experience would chime i= n >> here... I'm pretty sure I don't have all the answers, so I don't want to >> seem like I'm trying to dictate the discussion. >> >> Ceej >> aka Chris Hillery >> >> On Wed, Sep 23, 2015 at 3:38 PM, Chris Hillery >> wrote: >> >> On Wed, Sep 23, 2015 at 10:40 AM, Jianfeng Jia >>> wrote: >>> >>> I hit another similar scenario that squash may make things harder. >>>> >>>> Now I=E2=80=99m working the UTF8 encoding task. Some part of work has = been done >>>> in Taewoo=E2=80=99s branch. But his branch is a bigger change that won= =E2=80=99t get >>>> into >>>> master >>>> soon. I=E2=80=99d like to cherry-pick several commits from his branch = and then >>>> continue >>>> on my task. Then both of us won=E2=80=99t hit the merging conflict in = future. >>>> >>>> >>> That is, I believe, already not true. Cherry-pick and squashed merge ha= ve >>> basically the same effect - they create a new commit with no lineage to >>> the >>> original. If you cherry-pick from his branch, then even if you merged >>> yours >>> to the trunk (rather than squashing), he'd still get conflicts the next >>> time he updated. >>> >>> I will admit I'm not 100% sure I'm correct about this. I've seen some >>> evidence that git can handle a rebase when the two branches each have a >>> *single* commit which happens to contain precisely the same diffs, as >>> would >>> happen with a cherry-pick that didn't require any conflict resolution o= f >>> its own. I'm not confident this always works, and I've never experiment= ed >>> to see if it works on a merge rather than a rebase. I wouldn't want to >>> make >>> any sweeping process decisions until at least we were sure we understoo= d >>> what works and what doesn't. >>> >>> If we did merges all the time instead of squashes and cherry-picks, the= n >>> you would be able to share some of Taewoo's work if you could *merge* i= t >>> to >>> your branch. But as you might guess, merging a couple of changes from t= he >>> middle of a foreign branch is quite challenging at best. >>> >>> Ceej >>> aka Chris Hillery >>> >>> --001a1140fdea08e0840520742c92--