From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D92CC43331 for ; Mon, 30 Mar 2020 12:13:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B94920716 for ; Mon, 30 Mar 2020 12:13:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X/J1JAgC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730084AbgC3MNk (ORCPT ); Mon, 30 Mar 2020 08:13:40 -0400 Received: from mail-qv1-f67.google.com ([209.85.219.67]:33054 "EHLO mail-qv1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729996AbgC3MNk (ORCPT ); Mon, 30 Mar 2020 08:13:40 -0400 Received: by mail-qv1-f67.google.com with SMTP id p19so8744090qve.0 for ; Mon, 30 Mar 2020 05:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wjGCip/hpGJBWTL3ukT8ZY41odfBMJ+rmQB6FupQolM=; b=X/J1JAgCPkmHKM8M2w03wtSqrgawKOtp3FaUK7KZXrdCT53Jai5wM7PmBgIRsf4q6w 08pKIc46Km84tvoWoW4bpNFRCNSQMIGIZS4BJdwiBjxTNoyVxY/G8crWJ+PB+SfUiuUn uW09D4Qrt+V3/cq+A2QiLrOsMXSvR841TSxMODdyY4Ofm4rt9XQnoamfiZTaLefy3PNZ WWDVmWRBqeZZxqa2G0XlwbSt0RRF+fV0iPquMU8fsW5R8SU9tJh7EQM/fhCucZ3ecuXV bXyO+DHY8i1VkQVVwibBDb13wF9Yzfz0CxrIslyye9SFsCu7a1yqBEiQ/UUzqx2xgb6s aSzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wjGCip/hpGJBWTL3ukT8ZY41odfBMJ+rmQB6FupQolM=; b=Tn69001FUyPmnwPgjt5ZmufiimyE7PeliY3PVaZRoRSH7BhY2TZQBN3c5NzO+ECJ1k T9+qVnPg2lEFgC/NXBXITjiOvRxfQH7M8wuuE16s6wfhysQLanSTp7A0/PUkCNF+bBA3 2n4Olg1+qfVrc2Pj7bL6bWn1KDXEju7jessPQNoS2a5hOWWJBntPd2ZIzzxM4lyZ3cKz rKEeDXSv9bdZnT/nASx+MPbS+IORrT4XMz+cAjEuPFfE+W7tOp/INTkf81MjltE5eOEc 83KWQ0pZzk6J+z65eivt+mgQ2pjL1ANCzZIFsuPpYXlcWWZWCn9mrg1lIszv9IqisDt1 jG3g== X-Gm-Message-State: ANhLgQ3TISbKYaAOapK/gwfMx9rVF1C2/rTcUMoqofVRnQAz6v9J6SnE 7cZSPk5jfSyc44hrG1K1qXI= X-Google-Smtp-Source: ADFU+vuui5gjbW1BOiuInHHn9YznUj9/79aaWIvkYWDVrw+SBS5YpWB1xD+3vkg5DcSpRBZp86kZJg== X-Received: by 2002:a05:6214:1863:: with SMTP id eh3mr11597951qvb.71.1585570415924; Mon, 30 Mar 2020 05:13:35 -0700 (PDT) Received: from [192.168.1.83] ([99.85.27.166]) by smtp.gmail.com with ESMTPSA id g187sm9904665qkf.115.2020.03.30.05.13.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Mar 2020 05:13:34 -0700 (PDT) Subject: Re: [PATCH v3] rebase --merge: optionally skip upstreamed commits To: Jonathan Tan , git@vger.kernel.org Cc: congdanhqx@gmail.com, newren@gmail.com, gitster@pobox.com References: <20200309205523.121319-1-jonathantanmy@google.com> <20200330040621.13701-1-jonathantanmy@google.com> From: Derrick Stolee Message-ID: Date: Mon, 30 Mar 2020 08:13:32 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Thunderbird/75.0 MIME-Version: 1.0 In-Reply-To: <20200330040621.13701-1-jonathantanmy@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 3/30/2020 12:06 AM, Jonathan Tan wrote: > When rebasing against an upstream that has had many commits since the > original branch was created: > > O -- O -- ... -- O -- O (upstream) > \ > -- O (my-dev-branch) > > it must read the contents of every novel upstream commit, in addition to > the tip of the upstream and the merge base, because "git rebase" > attempts to exclude commits that are duplicates of upstream ones. This > can be a significant performance hit, especially in a partial clone, > wherein a read of an object may end up being a fetch. > > Add a flag to "git rebase" to allow suppression of this feature. This > flag only works when using the "merge" backend. So this is the behavior that already exists, and you are providing a way to suppress it. However, you also change the default in this patch, which may surprise users expecting this behavior to continue. > This flag changes the behavior of sequencer_make_script(), called from > do_interactive_rebase() <- run_rebase_interactive() <- > run_specific_rebase() <- cmd_rebase(). With this flag, limit_list() > (indirectly called from sequencer_make_script() through > prepare_revision_walk()) will no longer call cherry_pick_list(), and > thus PATCHSAME is no longer set. Refraining from setting PATCHSAME both > means that the intermediate commits in upstream are no longer read (as > shown by the test) and means that no PATCHSAME-caused skipping of > commits is done by sequencer_make_script(), either directly or through > make_script_with_merges(). > > Signed-off-by: Jonathan Tan > Signed-off-by: Junio C Hamano > --- > This commit contains Junio's sign-off because I based it on > jt/rebase-allow-duplicate. > > This does not include the fix by Đoàn Trần Công Danh. If we want all > commits to pass all tests (whether run by Busybox or not) it seems like > we should squash that patch instead of having it as a separate commit. > If we do squash, maybe include a "Helped-by" with Đoàn Trần Công Danh's > name. > > Junio wrote [1]: > >> Sounds much better to me. I do not mind --[no-]keep-cherry-pick, >> either, by the way. I know I raised the possibility of having to >> make it non-bool later, but since then I haven't thought of a good >> third option myself anyway, so... > > In that case, I think it's better to stick to bool. This also means that > the change from the version in jt/rebase-allow-duplicate is very small, > hopefully aiding reviewers - mostly a replacement of > --skip-cherry-pick-detection with --keep-cherry-pick (which mean the > same thing). > > [1] https://lore.kernel.org/git/xmqq4kuakjcn.fsf@gitster.c.googlers.com/ > --- > Documentation/git-rebase.txt | 21 +++++++++- > builtin/rebase.c | 7 ++++ > sequencer.c | 3 +- > sequencer.h | 2 +- > t/t3402-rebase-merge.sh | 77 ++++++++++++++++++++++++++++++++++++ > 5 files changed, 107 insertions(+), 3 deletions(-) > > diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt > index 0c4f038dd6..f4f8afeb9a 100644 > --- a/Documentation/git-rebase.txt > +++ b/Documentation/git-rebase.txt > @@ -318,6 +318,21 @@ See also INCOMPATIBLE OPTIONS below. > + > See also INCOMPATIBLE OPTIONS below. > > +--keep-cherry-pick:: > +--no-keep-cherry-pick:: I noticed that this _could_ have been simplified to --[no-]keep-cherry-pick:: but I also see several uses of either in our documentation. Do we have a preference? By inspecting the lines before a "no-" string, I see that some have these two lines, some use the [no-] pattern, and others highlight the --no-