Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6099392ybi; Tue, 4 Jun 2019 18:56:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLK1rMT1CDVeU0YBUHt3Qy/DB7BLelgWtpmY90EVuTVwjAXfTVcADX4Duq7yF2cE10bEjm X-Received: by 2002:a63:4d0f:: with SMTP id a15mr889225pgb.59.1559699792362; Tue, 04 Jun 2019 18:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559699792; cv=none; d=google.com; s=arc-20160816; b=H2sdM5vfBVlol0ov9eCh0pDXyiVe1ZmOXtYvj/s3OumapWgQmMPymyL2MdylPIAq0C 9ymnylbLQKLG7bfuJJ+K/h8B192OtworYoPtMdAKYPSTeCGqfDsMEhFa0OMat7aNkeBI nqzwWf8vKuDTzyoSG+aejL4m8Jszyd3GW9RHOiazWpvZqaQn29jxoz8W3KMwl/WSLTLv lf5KpDxkggbeh+Nt4IcMR78WLMvurlUSp6h75dvbLOSxvXJzOYXokK3zjRAXlT6W0JC6 u/CSoV2kCPPbWTp/jFnSNmDtMgUNZcBCL2vuFHWC2k9qHdCGqpvFOz7JhbJ5yidxlKk1 vx2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=LXaIDJji7ynAYI534e02DCJp/tTh+A1vWWAjfx6o4ng=; b=NHKQeWG7NOunSsEKRvr/1lHmmSnKXnXjlV7q+7zMqVdhl4X7TJvDSASh/YaDQEXGD1 BC/ZRwNXXtluA8q7/xPn95A1xIoBGX5au/PO1jlqMGlUziY9MTsvdfshqpKMFknVCMqp VQz/tgB3tLHAhjtFkR8UJAcO7/7u/8AbY0B6vCEUswsv0SRbItTv2AN7pAVlEhq1CsSM 6EuZEQw1xrPK0WPJo77545eq1OtqsMAcITNDQ5T4/+wb0xL/qvpRMvOjmuIHztG8Thhc DOZ1PCShj51EFGRqGdQeKOJv2qUK7hRMIJoHj8aUlHBP88iKCDnK5UoYbZZ8jMIFqNOR XmTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si24822736pgv.315.2019.06.04.18.56.15; Tue, 04 Jun 2019 18:56:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726510AbfFEBzL (ORCPT + 99 others); Tue, 4 Jun 2019 21:55:11 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:41806 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726427AbfFEBzL (ORCPT ); Tue, 4 Jun 2019 21:55:11 -0400 Received: from callcc.thunk.org ([66.31.38.53]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x551su7B031707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 4 Jun 2019 21:54:57 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 7555B420481; Tue, 4 Jun 2019 21:54:56 -0400 (EDT) Date: Tue, 4 Jun 2019 21:54:56 -0400 From: "Theodore Ts'o" To: Jonathan Corbet Cc: linux-doc@vger.kernel.org, LKML , Linus Torvalds , Geert Uytterhoeven , David Rientjes Subject: Re: [PATCH v2] Add a document on rebasing and merging Message-ID: <20190605015456.GA2710@mit.edu> Mail-Followup-To: Theodore Ts'o , Jonathan Corbet , linux-doc@vger.kernel.org, LKML , Linus Torvalds , Geert Uytterhoeven , David Rientjes References: <20190604134835.16fc6bfa@lwn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190604134835.16fc6bfa@lwn.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 04, 2019 at 01:48:35PM -0600, Jonathan Corbet wrote: > + > +Maintaining a subsystem, as a general rule, requires a familiarity with > the +Git source-code management system. Git is a powerful tool with a lot > of +features; as is often the case with such tools, there are right and > wrong +ways to use those features. This document looks in particular at > the use +of rebasing and merging. Maintainers often get in trouble when > they use +those tools incorrectly, but avoiding problems is not actually > all that +hard. FYI, it looks like your patch somehow got hit by your text editor (or MUA's) line wrapping... > + > + - Realize that the rebasing a patch series changes the environment in > + which it was developed and, likely, invalidates much of the testing > that > + was done. A rebased patch series should, as a general rule, be treated > + like new code and retested from the beginning. Shouldn't "reparenting" be used in this paragraph? I suppose if a patch is getting dropped or modified that can invalidate some of the testing (although it really depends on the nature of what's being dropped or modified). And if it's just adding a Tested-by tag or a CVE number in the commit description, it's not going to invalidate any testing. As an aside, I wonder if git could pass down some kind of hint at "git fetch" time that a particular branch is one that is subject to frequent history rewriting, so it shouldn't be used as the basis for further work (unless the developer is someone who is really good at the "git rebase --onto ..." syntax). > +Even in the absence of known conflicts, doing a test merge before sending > a +pull request is a good idea. It may alert you to problems that you > somehow +didn't see from linux-next and helps to understand exactly what > you are +asking upstream to do. Some maintainers will actually do a test merge and then run regression tests on the result --- more than just a "it builds, ship it!" :-) > + > +Another reason for doing merges of upstream or another subsystem tree is > to +resolve dependencies. These dependency issues do happen at times, and > +sometimes a cross-merge with another tree is the best way to resolve them; > +as always, in such situations, the merge commit should explain why the > +merge has been done. Take a momehnt to do it right; people will read those > +changelogs. It might also be useful to mention it might be useful to put the commits which are needed to solve the dependency problem on its own separate branch, based off of something like -rc2, and then each of the trees which need the prerequisite commits can merge in that branch. BTW, this is another example where, if we couldn't figure this out in advance, I might consider it worthwhile to separate out prerequisite patches, and reparent them on top of -rc2, so that other trees don't have to do a cross-merge which pulls in half of some other subsystem's branch. Rewriting history on one branch and reparenting the changes so they are on their own branch might be a good tradeoff if it avoids messy cross-merges on multiple other trees. It also avoids this problem: > .... If that subsystem tree fails to be pulled > +upstream, whatever problems it had will block the merging of your tree as > +well. - Ted