Return-Path: X-Original-To: apmail-hadoop-common-dev-archive@www.apache.org Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AC6A918673 for ; Tue, 18 Aug 2015 00:43:59 +0000 (UTC) Received: (qmail 37607 invoked by uid 500); 18 Aug 2015 00:42:59 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 37539 invoked by uid 500); 18 Aug 2015 00:42:59 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 37526 invoked by uid 99); 18 Aug 2015 00:42:59 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2015 00:42:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B2AB5DE9AD for ; Tue, 18 Aug 2015 00:42:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.251 X-Spam-Level: *** X-Spam-Status: No, score=3.251 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 5d8bZBrUzxef for ; Tue, 18 Aug 2015 00:42:48 +0000 (UTC) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 3979A20FE7 for ; Tue, 18 Aug 2015 00:42:47 +0000 (UTC) Received: by obbfr1 with SMTP id fr1so127229313obb.1 for ; Mon, 17 Aug 2015 17:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=+IpAfBC+swVRWFvTotAzD6q3XGMyS6Z+61RLeD+FnmE=; b=ARS/yc26lrLjhPeLQufCRPBpXG4Sh3PdkdRGunoj9B/UA6W6S9f/O1pD9OVMq4mLEp v8gm+ixeZSiKFgFszMORAznOmM/wsh+aDklYPreg5Bwp61mxO7StdHKiNtRldlTTRc0a QXiTDgiGOPWJyb/pw22fnU5aBajQlnxVnmVkJCHtUu3RSTgrB8LqSpFT20Wh2h5Xld8A GlVQqFBk9ZGzRuPIOfW47hjbzJFNnt1Pswg4PNBd0pcE/vxp8XOBM3I1+qE3vu+BkmXS S4MfJZdiydPWk0+mDEuWEh4U3tidptzOH/6fPc9Xwa458fiUs5bQaVRzPVozgFzABw/f l71g== X-Received: by 10.182.196.72 with SMTP id ik8mr3458655obc.36.1439858566077; Mon, 17 Aug 2015 17:42:46 -0700 (PDT) MIME-Version: 1.0 Sender: sjlee0@gmail.com Received: by 10.202.130.147 with HTTP; Mon, 17 Aug 2015 17:42:26 -0700 (PDT) In-Reply-To: References: From: Sangjin Lee Date: Mon, 17 Aug 2015 17:42:26 -0700 X-Google-Sender-Auth: FmMDc7feQzTkPwYzqEmAMxDfql4 Message-ID: Subject: Re: [DISCUSS] git rebase vs. git merge for branch development To: "common-dev@hadoop.apache.org" Content-Type: multipart/alternative; boundary=089e015374f85ba832051d8b32f4 --089e015374f85ba832051d8b32f4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I also think allowing merges as a way to uprev with trunk would be a good idea. AFAIK, git rebase works well when your branch is short-lived and contains a fairly small number of commits, but doesn't work so well if your branch is large. Also, the cost of rebase will only go up as time goes. On the other hand, git merge has a pretty decent chance to succeed, especially more so if you merge the trunk often. My 2 cents. Sangjin On Mon, Aug 17, 2015 at 1:18 PM, Jing Zhao wrote: > I think we should allow merge-based workflows. I worked and am working in > several big feature branches, including HDFS-2802 (>100 subtasks) and > HDFS-7285 (currently already > 200 subtasks), and tried both the > merge-based and rebase-based workflows. When the feature change becomes > big, the rebase will become a big pain, considering a small change in tru= nk > can cause conflicts for rebasing large number of commits in the feature > branch. Using "git merge" to merge trunk changes into the feature branch = is > much easier in this case. > > Thanks, > -Jing > > On Mon, Aug 17, 2015 at 12:17 PM, Andrew Wang > wrote: > > > Hi all, > > > > I've thought about this topic more over the last week, and felt I shoul= d > > play devil's advocate for a merge workflow. A few comments: > > > > - The issue of merges "polluting history" is mainly an issue when > using > > a github PR workflow, which results in one merge per PR. Clearly thi= s > is > > not okay, but a separate issue from feature branches. We only have a > > handful of merge commits per feature branch. > > - The issue of changes hiding in merge commits can happen when > resolving > > rebase conflicts too, except it's harder to track. Right now neither > go > > through code review, which is sketchy. We probably should review the= se > > too, > > and it's easier to review a single merge commit vs. an entire rebase= d > > branch. Merge is also a more natural way of integrating changes from > > trunk, > > since you just resolve all conflicts at once at the end. > > - Merge gives us a linear history on the branch but worse history on > > trunk/branch-2. Rebase has worse history on the branch but a linear > > history > > on trunk/branch-2. This means for quick/small feature branches that > > don't > > have a lot of conflicts, rebase is preferred. For large features wit= h > > lots > > of conflicts, merge is preferred. This is basically what we're runni= ng > > into > > on HDFS-7285. > > - Rebase also comes with increased coordination costs, since public > > history is being rewritten. This is again okay for smaller efforts > > (where > > there are fewer contributors), but more painful with bigger ones. > There > > have been a number of HDFS-7285 branches created basically as a resu= lt > > of > > rebase, with corresponding JIRA discussions about where to commit > > things. > > - The issue of a single squashed commit for the branch-2 backport is > > arguably an issue with how we structure our branches. If release > > branches > > forked off of trunk rather than branch-2, we wouldn't have this > > problem. We > > could require branch-2 integration to also happen via git merge. Or = we > > kick > > trunk out to a feature branch based off of branch-2. Or we shrug and > > keep > > the status quo. > > > > I'd definitely appreciate commentary from others who've worked on featu= re > > branches in git, even in communities outside of Hadoop. > > > > If there is support for allowing merge-based workflows in addition to > > rebase, we'd need to kick off a [VOTE] thread since the last [VOTE] onl= y > > allows rebase. > > > > Best, > > Andrew > > > > On Mon, Aug 17, 2015 at 11:33 AM, Andrew Wang > > wrote: > > > > > @Sangjin, > > > > > > I believe this is covered by the [VOTE] I linked to above, key excerp= t > > > being: > > > > > > 3. Force-push on feature-branches is allowed. Before pulling in a > > > feature, the feature-branch should be rebased on latest trunk and > the > > > changes applied to trunk through "git rebase --onto" or "git > > cherry-pick > > > ". > > > > > > This specifies that the last uprev final integration of the branch in= to > > trunk happen with rebase. It doesn't say anything about the periodic > > uprev's, but it'd be very strange to merge periodically and then rebase > > once at the end. So I take it to mean doing periodic uprevs with rebase > too. > > > > > > > > > On Mon, Aug 17, 2015 at 11:23 AM, Sangjin Lee > wrote: > > > > > >> Just to be clear, are we discussing the process of uprev'ing the > feature > > >> development branch with the latest from the trunk from time to time, > or > > >> making the final merge of the feature branch onto the trunk? > > >> > > >> On Mon, Aug 17, 2015 at 10:21 AM, Steve Loughran < > > stevel@hortonworks.com> > > >> wrote: > > >> > > >> > I haven't done a bit piece of work in the ASF code repo since the > > >> > migration to git; though I have done it in the svn era. > > >> > > > >> > > > >> > Currently with private git repos > > >> > -anyone gets SCM control of their source > > >> > -you can commit for your own reasons (about to make a change, want= a > > >> > private jenkins run, ...) and gain from having many small checkins= . > > More > > >> > succinctly: if you aren't checking in your work 2+ times a day =E2= =80=94why > > not? > > >> > -rebasing a painful necessity on personal, private branches to kee= p > > the > > >> > final patch to hadoop git a single diff > > >> > > > >> > With the private git process that's the defacto standard, we lose > > >> history > > >> > anyway. I know what I've done and somewhere there's a tag in my ow= n > > >> github > > >> > repo of my work to create a JIRA. But we don't always need that > entire > > >> > history of "trying to debug kerberos", "typo in exception", and > other > > >> stuff > > >> > that accrues during the work. > > >> > > > >> > I think therefore that I'm in favour of big squash commits. What w= e > > >> could > > >> > do is extend that with a policy of > > >> > > > >> > > > >> > 1. tag the final commit used to make the patch, something like > > >> > tag_HADOOP-8192. The tag ensures that the history isn't gc'd > > >> > 2. Delete the branch (keeps the #of branches down) > > >> > 3. In the JIRA, include the name of the tag and the git commit > > number > > >> > in the comments. Someone curious can rebuild that history > > >> > > > >> > > > >> > > > > > > > > > --089e015374f85ba832051d8b32f4--