From patchwork Tue Nov 24 13:30:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11928915 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 9410DC63798 for ; Tue, 24 Nov 2020 13:31:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A0C02087D for ; Tue, 24 Nov 2020 13:31:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XLkZjJnQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388261AbgKXNap (ORCPT ); Tue, 24 Nov 2020 08:30:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388060AbgKXNan (ORCPT ); Tue, 24 Nov 2020 08:30:43 -0500 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00D2AC0613D6 for ; Tue, 24 Nov 2020 05:30:42 -0800 (PST) Received: by mail-ot1-x343.google.com with SMTP id k3so19300485otp.12 for ; Tue, 24 Nov 2020 05:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+BoELlIO2Np/7X0XEhnINPzKgRHlCgI89Vir8ImGdC4=; b=XLkZjJnQQj8ZD26Ij61HBACOpL8tjiWKRCoTSPMMreEczvMa/+11v81tmA6H0MPiAX O4gSzOrRja4diEnw2g3nUP7YayYs+9eyUKPtvZuWR9s7fu0iGfbuEZ2uwopJz38TvJbv OUTAc4jK1Bft/jwZoN1/7HsidxF6tjkgY+DzjKHCXX3M3aCcvmzhl5wtMnpDFWveG74A F3Hqy31lUwgRuqNb/pv1/zW9W5SYIRA2vpZMbkrGyVnAhEtCTw1zRsfSTc1K+YbPvJzP VrF9OnRwNV7GNI5uiGX7Vl+N6HRY1miOgrIrJ25Yr0Ec/SEEjoSKzp9xlX4oSRf2K9DC QNCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+BoELlIO2Np/7X0XEhnINPzKgRHlCgI89Vir8ImGdC4=; b=kpHV55invwv/guQP7knPhPQZd/Og6ji+hWIqG02nenUvjickGziOwdPIhHpxV4rmC8 kebDPq11CNadTGPBAzs7HpUGyUsS18FeWvLnHOiwW98SMokcl9tCbFRVHZfsfR7Di9SS UyMEOznxkhCJy+7fNl9Fb3+Ljtlf6v//BtwL1B3LicBTo+a1bL3eTSufEE0Lm0Gk3fts udrt/qz0cR4LUBfY8h7pFmfHYrQgKGziyT562QeZYtlB/sl1lvuBhpE83TJPaiQRWtQR Q5D7vaV6/2Bo7IJHUaR0+aIOA14nhnuKJY/AtAy64I12UrQ1Q3IiCKx08DayPONjlulU 8b8A== X-Gm-Message-State: AOAM531uSTUdHM3wWlS5vFhiBxLf0kW0VF75IRccVwlzOMGuzNganTri AFTVILsKQEiXs1k4CUP+JlgviuMlnj4+rw== X-Google-Smtp-Source: ABdhPJx57xrQ31qknPW989yFsmFenTbHZZfx9d38olUG+LZ6UpIdAOjsUM2mO7mgohDhW//JordGHg== X-Received: by 2002:a9d:336:: with SMTP id 51mr3432266otv.29.1606224641400; Tue, 24 Nov 2020 05:30:41 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id s193sm9501273oos.21.2020.11.24.05.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 05:30:40 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?V=C3=ADt_Ondruch?= , Alex Henrie , "Theodore Y . Ts'o" , Jeff King , Junio C Hamano , Elijah Newren , Felipe Contreras Subject: [PATCH 1/6] pull: refactor fast-forward check Date: Tue, 24 Nov 2020 07:30:32 -0600 Message-Id: <20201124133037.89949-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124133037.89949-1-felipe.contreras@gmail.com> References: <20201124133037.89949-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This way we will be able to do the check unconditionally (merge or rebase). Signed-off-by: Felipe Contreras --- builtin/pull.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index 17aa63cd35..e2de0d4c91 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -906,6 +906,20 @@ static int run_rebase(const struct object_id *curr_head, return ret; } +static int get_can_ff(struct object_id *orig_head, struct object_id *orig_merge_head) +{ + int ret; + struct commit_list *list = NULL; + struct commit *merge_head, *head; + + head = lookup_commit_reference(the_repository, orig_head); + commit_list_insert(head, &list); + merge_head = lookup_commit_reference(the_repository, orig_merge_head); + ret = repo_is_descendant_of(the_repository, merge_head, list); + free_commit_list(list); + return ret; +} + int cmd_pull(int argc, const char **argv, const char *prefix) { const char *repo, **refspecs; @@ -1016,22 +1030,12 @@ int cmd_pull(int argc, const char **argv, const char *prefix) submodule_touches_in_range(the_repository, &rebase_fork_point, &curr_head)) die(_("cannot rebase with locally recorded submodule modifications")); if (!autostash) { - struct commit_list *list = NULL; - struct commit *merge_head, *head; - - head = lookup_commit_reference(the_repository, - &orig_head); - commit_list_insert(head, &list); - merge_head = lookup_commit_reference(the_repository, - &merge_heads.oid[0]); - if (repo_is_descendant_of(the_repository, - merge_head, list)) { + if (get_can_ff(&orig_head, &merge_heads.oid[0])) { /* we can fast-forward this without invoking rebase */ opt_ff = "--ff-only"; ran_ff = 1; ret = run_merge(); } - free_commit_list(list); } if (!ran_ff) ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point); From patchwork Tue Nov 24 13:30:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11928917 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 C2A2DC2D0E4 for ; Tue, 24 Nov 2020 13:31:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58CD62076E for ; Tue, 24 Nov 2020 13:31:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jbFiJA6y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388263AbgKXNap (ORCPT ); Tue, 24 Nov 2020 08:30:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388258AbgKXNao (ORCPT ); Tue, 24 Nov 2020 08:30:44 -0500 Received: from mail-oo1-xc42.google.com (mail-oo1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E15BC0613D6 for ; Tue, 24 Nov 2020 05:30:44 -0800 (PST) Received: by mail-oo1-xc42.google.com with SMTP id s11so3957200oov.13 for ; Tue, 24 Nov 2020 05:30:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F8TR9CXxovhFgUmDZOL3LJSPyrt2FqATKBTfuUSfEPI=; b=jbFiJA6yQxb1+N8+VUrJLqlbuBx4bMZCwNnnvN9Hv6z2jOV8qIfbb4oaKbZn8SQh7t DhdmMmbWTQF3ZjIC7xaTKtYsTITjsBEyw2jI5b/Rt7Cw9CZNdV1nbg/ZrLGCYArd/Kq/ OmfygLqNsemKitpbUk0L1YJ7a1k089AWFRgISni4BiLvBQdniFJ2Z1nUgeiMQxM7b1/x kUCnwKDlhXSy0QK7N/s5MbexBJ5kvM9I71ZskhCg+YKotJ+7B0tnn8GJL1+9GFT0Jmxf sAtkAIYiYp4LBhWliLh0WcBdtvTrCUDEjVm5Np8hmMzIX4FyRWtaLfYMIp2986jZlWTw HysQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F8TR9CXxovhFgUmDZOL3LJSPyrt2FqATKBTfuUSfEPI=; b=HHZ1MkYjYHuRbao3ua1pXr7ayX0Id8AvuSzJXTCm/ywnU71YaUd0Al2VYLheArMgxh 2UQl3Tt3PY/j1bpgvxL5bo/jXLUX4erjVTrsivb1Wfw/Ovg/K9j0nexu6aYTNhaf5EIx Ih0lZnzfTbDF/JN61uThsEHD4vo6XaVE9H2Z8q7Chpk5OnO6TLeSV7P7Kw4X8wbrnRYx LeT+8VswZN/gv2a3Y7Qs0wxPJO1TsgE35VsIiah4q6KVN+JEkm7Je+XmO+pZHm4+w97w pDHe8isVE9A7y0mP+VAPCg4R5mnePEkkNvDQcy3n9XBow9nRjbqIt+vsTRjnucPtgOdX ZI3w== X-Gm-Message-State: AOAM533fwtlE/MrCq2EfvgGLIJ/aNTplQKPYhs69cB7DQryDekMmRpLE OeYmrWyoxMPOfcQe+NketMl236qYsVZccA== X-Google-Smtp-Source: ABdhPJzhETd5PS5uPdEqF+oaxrX66HGP4poqWpdqp1Ww42Hc82ilYgSMYP6NLJ8slx+/FpsuExBtIw== X-Received: by 2002:a4a:3e91:: with SMTP id t139mr3158776oot.90.1606224643562; Tue, 24 Nov 2020 05:30:43 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id b23sm9338660ooa.13.2020.11.24.05.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 05:30:42 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?V=C3=ADt_Ondruch?= , Alex Henrie , "Theodore Y . Ts'o" , Jeff King , Junio C Hamano , Elijah Newren , Felipe Contreras Subject: [PATCH 2/6] pull: cleanup autostash check Date: Tue, 24 Nov 2020 07:30:33 -0600 Message-Id: <20201124133037.89949-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124133037.89949-1-felipe.contreras@gmail.com> References: <20201124133037.89949-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This essentially reverts commit f15e7cf5cc. Once commit d9f15d37f1 introduced the autostash option for the merge mode, it's no necessary to skip the fast-forward run_merge() when autostash is set. Signed-off-by: Felipe Contreras --- builtin/pull.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index e2de0d4c91..eaa268c559 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -926,7 +926,6 @@ int cmd_pull(int argc, const char **argv, const char *prefix) struct oid_array merge_heads = OID_ARRAY_INIT; struct object_id orig_head, curr_head; struct object_id rebase_fork_point; - int autostash; if (!getenv("GIT_REFLOG_ACTION")) set_reflog_message(argc, argv); @@ -959,8 +958,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix) if (get_oid("HEAD", &orig_head)) oidclr(&orig_head); - autostash = config_autostash; if (opt_rebase) { + int autostash = config_autostash; if (opt_autostash != -1) autostash = opt_autostash; @@ -1029,13 +1028,11 @@ int cmd_pull(int argc, const char **argv, const char *prefix) recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) && submodule_touches_in_range(the_repository, &rebase_fork_point, &curr_head)) die(_("cannot rebase with locally recorded submodule modifications")); - if (!autostash) { - if (get_can_ff(&orig_head, &merge_heads.oid[0])) { - /* we can fast-forward this without invoking rebase */ - opt_ff = "--ff-only"; - ran_ff = 1; - ret = run_merge(); - } + if (get_can_ff(&orig_head, &merge_heads.oid[0])) { + /* we can fast-forward this without invoking rebase */ + opt_ff = "--ff-only"; + ran_ff = 1; + ret = run_merge(); } if (!ran_ff) ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point); From patchwork Tue Nov 24 13:30:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11928919 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 DD4B5C6379D for ; Tue, 24 Nov 2020 13:31:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9250020872 for ; Tue, 24 Nov 2020 13:31:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="itgOo3Ka" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388268AbgKXNat (ORCPT ); Tue, 24 Nov 2020 08:30:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388264AbgKXNas (ORCPT ); Tue, 24 Nov 2020 08:30:48 -0500 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51C3BC0613D6 for ; Tue, 24 Nov 2020 05:30:46 -0800 (PST) Received: by mail-ot1-x343.google.com with SMTP id 92so16248359otd.5 for ; Tue, 24 Nov 2020 05:30:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G+qUZvG5cVmpBLeKyUiG5isfp33kmjrbi203XrgYD3U=; b=itgOo3KaoalK6J4YOI4lfTJ6CpyjuihZWG5HDH84KCkNWzdXg8QJ22FMevlCTAdYJQ G+HAQk1/MOMMNlO7+VWWLHaLsJgaME5B++Gfqrs8FPGsJOJwtpmUgVW/o4nAkXhX46Bd FecXiTtq3zutmAnfM4nAGc7xM6g//kzxzfXVdcEsoEVwKktGx2FBjag0D/WWLcLVIOwP m6ipYgbJhR/PjSv8Jb8Ff7IChusaMnoDMvz2OTMDTNOCQyDNCgcao5DDuqCIBjLtwUhD TjnNiRyd3Fu14tSsmy10Om0OnlywlaVpLl1mAGB0DeTSotIr7+9jhgYbIKqEK8wHmBMF ujww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G+qUZvG5cVmpBLeKyUiG5isfp33kmjrbi203XrgYD3U=; b=jtSqrnw84wxaPP8U1eNm49wpKOO9mu2T0BaO9ZYIN0Se7+xzJtcxJHcIlUIdeLgsi8 UFlhI2i5576Zrdrk2lq5Ibebw9O1AvWCr8AIKxVKVsTookcjRgH302C5pJGVK7PXKZy9 H4n5dXJxYKUIVNbjz6om8XI39/NeYgYA3kQlNDEvw488cfl0ak/c7HAvdoDGlZL/qjO6 mxePKlym6Z4Hl5n1FQsIot3Jy0VEGYsjDwjZ5A04UKtwtnaJlopz660kljkWYoIEDLRg xNKKunwjOAtEIxLGSwD9dmeQOysbQ6TzntVROzilZ2LALXsIa+6RVV0Z0XJ8uV9RjPew cCig== X-Gm-Message-State: AOAM5312Nac0bGj8ZeVPCq496joS677BKZr9yXXVBaLnQXkYqWSXaDS1 7sjovL75gq+va1HJ83RE0rGDMe+P0e1mQw== X-Google-Smtp-Source: ABdhPJzkzjsk+vtVkkvkmHp20Ob1lHrT9vrrg0+7no3MWJd8yNIQIa2bjcNTuC++e3M7qSFHr3go3w== X-Received: by 2002:a05:6830:2368:: with SMTP id r8mr3338275oth.75.1606224645296; Tue, 24 Nov 2020 05:30:45 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id g3sm9399985oif.26.2020.11.24.05.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 05:30:44 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?V=C3=ADt_Ondruch?= , Alex Henrie , "Theodore Y . Ts'o" , Jeff King , Junio C Hamano , Elijah Newren , Felipe Contreras Subject: [PATCH 3/6] pull: trivial cleanup Date: Tue, 24 Nov 2020 07:30:34 -0600 Message-Id: <20201124133037.89949-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124133037.89949-1-felipe.contreras@gmail.com> References: <20201124133037.89949-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There's no need to store ran_ff. Now it's obvious from the conditionals. Signed-off-by: Felipe Contreras --- builtin/pull.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index eaa268c559..121b9fb0e1 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -1023,19 +1023,18 @@ int cmd_pull(int argc, const char **argv, const char *prefix) if (opt_rebase) { int ret = 0; - int ran_ff = 0; if ((recurse_submodules == RECURSE_SUBMODULES_ON || recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) && submodule_touches_in_range(the_repository, &rebase_fork_point, &curr_head)) die(_("cannot rebase with locally recorded submodule modifications")); + if (get_can_ff(&orig_head, &merge_heads.oid[0])) { /* we can fast-forward this without invoking rebase */ opt_ff = "--ff-only"; - ran_ff = 1; ret = run_merge(); - } - if (!ran_ff) + } else { ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point); + } if (!ret && (recurse_submodules == RECURSE_SUBMODULES_ON || recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND)) From patchwork Tue Nov 24 13:30:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11928921 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 068F0C64E7A for ; Tue, 24 Nov 2020 13:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBD6A204EC for ; Tue, 24 Nov 2020 13:31:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J1Aj6yZq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388272AbgKXNau (ORCPT ); Tue, 24 Nov 2020 08:30:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388265AbgKXNas (ORCPT ); Tue, 24 Nov 2020 08:30:48 -0500 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226D1C0617A6 for ; Tue, 24 Nov 2020 05:30:48 -0800 (PST) Received: by mail-oi1-x242.google.com with SMTP id a130so15660734oif.7 for ; Tue, 24 Nov 2020 05:30:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M0pc6VuEbfwATsQhF7UER4sXqH17WZgWHxeF74B6unY=; b=J1Aj6yZqGUxsqPm+CGM1JgD7IJ7FgLvdXBf9V4qnSmUDPflqCEa5Vcac4Sz/aFBHeM YFy2sh1CodlEi9sFYbgFNS5404b2JOMktU5qXpafGsgNiUNwDs8J+qV4TsQEellf+DEc HR+3UMIPQjMzXFSdEm13MSqgQzYmm4uLLaY03WWSAMYslsZXL47R+YLmX0uYLNbtmdQO J7dUJ4LogNEmiyxJNtBIS++zzwrms4htPc8Bf0HXZmQR6opZEZXIvINUwe6n5jO9z8qr ZwfCpsVmjjQcF3wpzBe1q++FHdBhldRbNzIAdtzJBR2GW1iMgL5yguaK8U4e9dY1dubx Hb0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M0pc6VuEbfwATsQhF7UER4sXqH17WZgWHxeF74B6unY=; b=NnG5SjI7JMbfyDz4NamBngkHuil2iZCGXVPLgd9Ges1iepgP0wbnT9SqGCzu9k5MLL Fp/MZbuC/T3DfwR7cOufzCKVqAooaylPX7oVE6kl9mi585FlWNqKQb6jATAuMKTGQIRT 7vubnDy+tfaWOpdQqwEYQ1Jje/GrmOEe+8+IWPJQGjaRMwvg5j9ekfwGNgwMQBUdd7X4 JQmXov3sJ7v12ZUagpTKynDDCuBTKxL9eoC0bh108O2AWyoj3dJ47r4Uvg+IAxDB5FkA Ox07fAOXew2LsUhtn+lT0YQIoLt3gyk05dCQS38qE2rZQZKSXIUt1nOCAQVw+lx55NDa 5k7w== X-Gm-Message-State: AOAM5333XJ1w1/HhLxX1GGJKe8jOcGe/XDqIKtvRjW2U88HDVtNnGh4k wWjbAfoqmrMpyOFsxdnPhscNDBMnm2aIkw== X-Google-Smtp-Source: ABdhPJyXV951F9lyFwa7U3dvzBS5ZFpGsFKr3am/emd/+LQ3GidY9kdtRs7yl3Z2tLgEmMA03T9ywg== X-Received: by 2002:aca:da02:: with SMTP id r2mr2728730oig.157.1606224647072; Tue, 24 Nov 2020 05:30:47 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id t10sm9362015oot.35.2020.11.24.05.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 05:30:46 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?V=C3=ADt_Ondruch?= , Alex Henrie , "Theodore Y . Ts'o" , Jeff King , Junio C Hamano , Elijah Newren , Felipe Contreras Subject: [PATCH 4/6] pull: move default warning Date: Tue, 24 Nov 2020 07:30:35 -0600 Message-Id: <20201124133037.89949-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124133037.89949-1-felipe.contreras@gmail.com> References: <20201124133037.89949-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Up to the point where can check if we can fast-forward or not. No functional changes. Signed-off-by: Felipe Contreras --- builtin/pull.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index 121b9fb0e1..9a0f7937c2 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -27,6 +27,8 @@ #include "commit-reach.h" #include "sequencer.h" +static int default_mode; + /** * Parses the value of --rebase. If value is a false value, returns * REBASE_FALSE. If value is a true value, returns REBASE_TRUE. If value is @@ -344,20 +346,7 @@ static enum rebase_type config_get_rebase(void) if (!git_config_get_value("pull.rebase", &value)) return parse_config_rebase("pull.rebase", value, 1); - if (opt_verbosity >= 0 && !opt_ff) { - warning(_("Pulling without specifying how to reconcile divergent branches is\n" - "discouraged. You can squelch this message by running one of the following\n" - "commands sometime before your next pull:\n" - "\n" - " git config pull.rebase false # merge (the default strategy)\n" - " git config pull.rebase true # rebase\n" - " git config pull.ff only # fast-forward only\n" - "\n" - "You can replace \"git config\" with \"git config --global\" to set a default\n" - "preference for all repositories. You can also pass --rebase, --no-rebase,\n" - "or --ff-only on the command line to override the configured default per\n" - "invocation.\n")); - } + default_mode = 1; return REBASE_FALSE; } @@ -926,6 +915,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix) struct oid_array merge_heads = OID_ARRAY_INIT; struct object_id orig_head, curr_head; struct object_id rebase_fork_point; + int can_ff; if (!getenv("GIT_REFLOG_ACTION")) set_reflog_message(argc, argv); @@ -1021,6 +1011,23 @@ int cmd_pull(int argc, const char **argv, const char *prefix) if (opt_rebase && merge_heads.nr > 1) die(_("Cannot rebase onto multiple branches.")); + can_ff = get_can_ff(&orig_head, &merge_heads.oid[0]); + + if (default_mode && opt_verbosity >= 0 && !opt_ff) { + warning(_("Pulling without specifying how to reconcile divergent branches is\n" + "discouraged. You can squelch this message by running one of the following\n" + "commands sometime before your next pull:\n" + "\n" + " git config pull.rebase false # merge (the default strategy)\n" + " git config pull.rebase true # rebase\n" + " git config pull.ff only # fast-forward only\n" + "\n" + "You can replace \"git config\" with \"git config --global\" to set a default\n" + "preference for all repositories. You can also pass --rebase, --no-rebase,\n" + "or --ff-only on the command line to override the configured default per\n" + "invocation.\n")); + } + if (opt_rebase) { int ret = 0; if ((recurse_submodules == RECURSE_SUBMODULES_ON || @@ -1028,7 +1035,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix) submodule_touches_in_range(the_repository, &rebase_fork_point, &curr_head)) die(_("cannot rebase with locally recorded submodule modifications")); - if (get_can_ff(&orig_head, &merge_heads.oid[0])) { + if (can_ff) { /* we can fast-forward this without invoking rebase */ opt_ff = "--ff-only"; ret = run_merge(); From patchwork Tue Nov 24 13:30:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11928923 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 5DF7EC64E75 for ; Tue, 24 Nov 2020 13:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ECFEC2076E for ; Tue, 24 Nov 2020 13:31:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Mxg8LepX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388277AbgKXNav (ORCPT ); Tue, 24 Nov 2020 08:30:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388270AbgKXNat (ORCPT ); Tue, 24 Nov 2020 08:30:49 -0500 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F0E4C0613D6 for ; Tue, 24 Nov 2020 05:30:49 -0800 (PST) Received: by mail-ot1-x342.google.com with SMTP id k3so19300815otp.12 for ; Tue, 24 Nov 2020 05:30:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YopPR/AjoLdffRlPvbN/TqwcUlY1u4pjOYs6LnV/vDw=; b=Mxg8LepXH26rRBgsbxT0CsUqGRZAFS1ozbnkt6LYh2UCW0V8b8ZsyRKvPnXJtmpk+G w4BTSGjeLor38dLz9RxFlwmqCCfz2oOegDC6gU0DcCCRO7Kl/T1k4AWfsyC5n+lGMzXJ cM3GgLfcjNkR35hAn+6tVl9UcsiqLVi4LvK5gfFMfjQ7AvFManqK+ucCpW9kLPbZH/2q qsrOfpMhI5d5QKgIjPZibwdfAfmNI558t2N/84ArO3N0s1mQCkpI0cNpB+ufi7YIOTx1 OEAP6ztMSs5WpBgtmBfLZ6IG89ZRbPTTlq7/gKXm013rWhF3sY1x/nUSo9/Y23/WPGsB /56Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YopPR/AjoLdffRlPvbN/TqwcUlY1u4pjOYs6LnV/vDw=; b=g+wEcqDn9AAUB39hQzNn2czrVQk2Aom3Pys1zt4QOd9r5WACqRrdU1SiBpOcfYlx7d ATcIGY40Q3s51lESkMv33CYlJpaYzemUCdpvvoSqydv3e5UFiDNIMWO2XmUQK4nc7D92 j74gpc/mLQ0vHoTLG823TsTPJ3cw9udNAU0T1FHDcOnUqquyZSjNSWrLMzqk8XO2j0L/ IE0eB13kxgaF5KllAA7BDKlBR9X2CJx0a8PcMQ8i5xZm+QpstbypnTkF06GfrLBBSOVT VKALMh8yJkRFBHDL1eZGtUh28OcPRkgHUFjcip4xhhpn3dcxBi9aJWQsOa9d3MOk+eb1 zgTQ== X-Gm-Message-State: AOAM533XA62DA7kpuNOY725ebuStsMpNKlhystwK/F8jk+/wjiuPTKvE iPA9d+sV5lJArQbmioj9coYS3kPcEDuK8g== X-Google-Smtp-Source: ABdhPJyUQtBu3nuliW3QBgEln/UXi6aKh8V8xZJ87tr5j3JoDK2cOfS8tsKQcfFmF4ExrAfA3XZIGg== X-Received: by 2002:a9d:6c99:: with SMTP id c25mr3473866otr.327.1606224648792; Tue, 24 Nov 2020 05:30:48 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id j46sm3702983oof.36.2020.11.24.05.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 05:30:48 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?V=C3=ADt_Ondruch?= , Alex Henrie , "Theodore Y . Ts'o" , Jeff King , Junio C Hamano , Elijah Newren , Felipe Contreras Subject: [PATCH 5/6] pull: display default warning only when non-ff Date: Tue, 24 Nov 2020 07:30:36 -0600 Message-Id: <20201124133037.89949-6-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124133037.89949-1-felipe.contreras@gmail.com> References: <20201124133037.89949-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org There's no need to display the annoying warning on every pull... only the ones that are not fast-forward. Signed-off-by: Felipe Contreras --- builtin/pull.c | 2 +- t/t7601-merge-pull-config.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index 9a0f7937c2..479bdaf0ee 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -1013,7 +1013,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix) can_ff = get_can_ff(&orig_head, &merge_heads.oid[0]); - if (default_mode && opt_verbosity >= 0 && !opt_ff) { + if (default_mode && !can_ff && opt_verbosity >= 0 && !opt_ff) { warning(_("Pulling without specifying how to reconcile divergent branches is\n" "discouraged. You can squelch this message by running one of the following\n" "commands sometime before your next pull:\n" diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh index c5c4ea5fc0..d79723877b 100755 --- a/t/t7601-merge-pull-config.sh +++ b/t/t7601-merge-pull-config.sh @@ -28,11 +28,17 @@ test_expect_success 'setup' ' ' test_expect_success 'pull.rebase not set' ' - git reset --hard c0 && + git reset --hard c2 && git pull . c1 2>err && test_i18ngrep "Pulling without specifying how to reconcile" err ' +test_expect_success 'pull.rebase not set (fast-forward)' ' + git reset --hard c0 && + git pull . c1 2>err && + test_i18ngrep ! "Pulling without specifying how to reconcile" err +' + test_expect_success 'pull.rebase not set and pull.ff=true' ' git reset --hard c0 && test_config pull.ff true && From patchwork Tue Nov 24 13:30:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 11928925 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 361D5C64E90 for ; Tue, 24 Nov 2020 13:31:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB53720866 for ; Tue, 24 Nov 2020 13:31:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T6tcLtp/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388293AbgKXNa7 (ORCPT ); Tue, 24 Nov 2020 08:30:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388288AbgKXNa4 (ORCPT ); Tue, 24 Nov 2020 08:30:56 -0500 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EA04C0613D6 for ; Tue, 24 Nov 2020 05:30:56 -0800 (PST) Received: by mail-oi1-x243.google.com with SMTP id l206so23705195oif.12 for ; Tue, 24 Nov 2020 05:30:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3SnoBkZ3kSMVpgqZ5NeBlt0BY1cD/WY+UmHuiONhlg8=; b=T6tcLtp/611yoXcBhFuJOflPX795XboTl827QVCJPwo5OABcd9ROZnOJen3rvu3pE9 HixovB2/jp1sOruVtAC6Zn+Exrt3Y2sF8xVm27e0tjFEXWUdjJISJaYpT7NUG4sVIcBe LBbB4rekKW0o81B8+p4e5t/xYIEecg2crYyBR94lYhP3iD5hiFCAciPzo/uPYfEg7gZ9 6mZZ0dqszN0mMswLOruc71IR9zG01hri7/xTPZFUJGr1QBTCIXGKxMiQSlv47yXiQZPa RXTopw05YP1MembqPnyIjEt85t7HchHVYGaEiAh1Z3rnHLWfDbjrMcet7nK2J0ArMsc+ C4FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3SnoBkZ3kSMVpgqZ5NeBlt0BY1cD/WY+UmHuiONhlg8=; b=izdazkQQfFz0ygWv90zaD9SruwOqYhIueWIaOBwNVAhm6US9gsc7w5N8W9UHUDK8Cb /NguNBguXayDN0UvKwJjvP1A4I/wv0opag24ZlqXSMJFPOYSePLmAEDUU+70V8iJF8iI 1F4u1F/ZHlL/wLM909cKBQJ/kJuAga//IF9TWi6Cabj9b0ESXBj0ek7G5OJYt7e98voV pD9zrEncLGqVRNtVvmtP+WYVSa1RLXKnOjhzKCEJKHcqKEq5bKTgHFNiS4iD0AKbYIS7 9lCbZQEekAsYpOkkMTaGMKyj1BoBuFdaQe542kGfZMS9AtkaUjczXsWPgntiZW2TL4qa AvBQ== X-Gm-Message-State: AOAM530LV550DVaxEqUQDocr82zSQFQ3qIFdvKxn8IalE674AzawD3IC j1D7g55kYxOQV+PUgN8lXuJwXu6XHN/Prg== X-Google-Smtp-Source: ABdhPJxhDJzMAQ1GqVPjILno+7aUA4/DPjE7nGVDQRQG/yqr3scXib+gb/UAt9FigkwyAIrUd6K5lA== X-Received: by 2002:aca:db0b:: with SMTP id s11mr2584661oig.51.1606224650802; Tue, 24 Nov 2020 05:30:50 -0800 (PST) Received: from localhost (189-209-26-110.static.axtel.net. [189.209.26.110]) by smtp.gmail.com with ESMTPSA id b28sm9820409oob.22.2020.11.24.05.30.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 05:30:49 -0800 (PST) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?q?V=C3=ADt_Ondruch?= , Alex Henrie , "Theodore Y . Ts'o" , Jeff King , Junio C Hamano , Elijah Newren , Felipe Contreras Subject: [PATCH 6/6] test: pull-options: revert unnecessary changes Date: Tue, 24 Nov 2020 07:30:37 -0600 Message-Id: <20201124133037.89949-7-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124133037.89949-1-felipe.contreras@gmail.com> References: <20201124133037.89949-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Commit d18c950a69 changed these tests, but it's unclear why. Probably because earlier versions of the patch series died instead of printing a warning. Cc: Alex Henrie Signed-off-by: Felipe Contreras --- t/t5521-pull-options.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh index db1a381cd9..1a4fe2583a 100755 --- a/t/t5521-pull-options.sh +++ b/t/t5521-pull-options.sh @@ -11,10 +11,10 @@ test_expect_success 'setup' ' git commit -m one) ' -test_expect_success 'git pull -q --no-rebase' ' +test_expect_success 'git pull -q' ' mkdir clonedq && (cd clonedq && git init && - git pull -q --no-rebase "../parent" >out 2>err && + git pull -q "../parent" >out 2>err && test_must_be_empty err && test_must_be_empty out) ' @@ -30,10 +30,10 @@ test_expect_success 'git pull -q --rebase' ' test_must_be_empty out) ' -test_expect_success 'git pull --no-rebase' ' +test_expect_success 'git pull' ' mkdir cloned && (cd cloned && git init && - git pull --no-rebase "../parent" >out 2>err && + git pull "../parent" >out 2>err && test -s err && test_must_be_empty out) ' @@ -46,10 +46,10 @@ test_expect_success 'git pull --rebase' ' test_must_be_empty out) ' -test_expect_success 'git pull -v --no-rebase' ' +test_expect_success 'git pull -v' ' mkdir clonedv && (cd clonedv && git init && - git pull -v --no-rebase "../parent" >out 2>err && + git pull -v "../parent" >out 2>err && test -s err && test_must_be_empty out) ' @@ -62,25 +62,25 @@ test_expect_success 'git pull -v --rebase' ' test_must_be_empty out) ' -test_expect_success 'git pull -v -q --no-rebase' ' +test_expect_success 'git pull -v -q' ' mkdir clonedvq && (cd clonedvq && git init && - git pull -v -q --no-rebase "../parent" >out 2>err && + git pull -v -q "../parent" >out 2>err && test_must_be_empty out && test_must_be_empty err) ' -test_expect_success 'git pull -q -v --no-rebase' ' +test_expect_success 'git pull -q -v' ' mkdir clonedqv && (cd clonedqv && git init && - git pull -q -v --no-rebase "../parent" >out 2>err && + git pull -q -v "../parent" >out 2>err && test_must_be_empty out && test -s err) ' test_expect_success 'git pull --cleanup errors early on invalid argument' ' mkdir clonedcleanup && (cd clonedcleanup && git init && - test_must_fail git pull --no-rebase --cleanup invalid "../parent" >out 2>err && + test_must_fail git pull --cleanup invalid "../parent" >out 2>err && test_must_be_empty out && test -s err) '