From patchwork Sun Jun 23 20:03:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Ashiwal X-Patchwork-Id: 11011923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4526E18E8 for ; Sun, 23 Jun 2019 20:06:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3825628ABE for ; Sun, 23 Jun 2019 20:06:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 258F528AC4; Sun, 23 Jun 2019 20:06:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B11D328AC4 for ; Sun, 23 Jun 2019 20:06:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbfFWUGL (ORCPT ); Sun, 23 Jun 2019 16:06:11 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43864 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbfFWUGL (ORCPT ); Sun, 23 Jun 2019 16:06:11 -0400 Received: by mail-pf1-f195.google.com with SMTP id i189so6236243pfg.10 for ; Sun, 23 Jun 2019 13:06:10 -0700 (PDT) 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=n2YnootIIhA9uv0o1Ssl3c+SBORnr9RTrLZW7WXiV14=; b=sAiJb/FproAMxfzCNY57tDCvocv2+TWaVr6wjiHw9SrkA8XRwVS4/bctjm4WPAN+mV Dmyl2Cc5H0GrLj5Ew0s8TbuZ7/AB0obRGDzUckkHpDUFeSGXuL/lJXSg4MSQ/ctnTkIi rCuvVFeC05L0Ph3zzMvvNn0gGWChSaWGBwm2VbVW+b+XuatQlmXN0ELUSBNDqlmbMvtY ENeDbaEWxAIGmUh7sX3n/UkXu+nRWMcnKPTK+3eOrtlfsWNM68AVbAMl3qVhp/N0SW5e hCzNISA3LxJRDQInEpRI1fveAVi+URbZugiHsdq4C+5irCLwxX0QXLGxoblbL7Ng8hOJ r+SQ== 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=n2YnootIIhA9uv0o1Ssl3c+SBORnr9RTrLZW7WXiV14=; b=Unj6CP7J8XJm+ylxVK3RX2KRpxeIhhXBoIs37aG3Mrg1pngTkKVQyCLLTEWkLxILib v6+ypSh3ylK4PeYmZmOrhnTPa1MBUMrG/s+8g3v3VQqWtLbiQq0zkWF52uubBBjNVjJW ezz0XhPLFcxjIX9ScxACKZZsbl1pHD+QF5Nh3by1e96kUVL4tnw5A+JkT7bIJsY50drO NXdxYniRmw4tNGSuzlqiVp8vmgyelGGw5dWBe2erNhklym1Vdl6KCv8dFRTs85Ervvb4 bbmo5blNL88+IxvuOeVTxFsnPy6AUbyETA4vJckZIwwnoiV0jKcYir8YSwErFGxbQBqj ql1Q== X-Gm-Message-State: APjAAAXDBiIab53QuCIiSMcONVyOoCke0Ih0+HJuhXXhwHyxxZs7+aGu /VMcittn2y2TnfFTICW5f44yJ3XFpyk= X-Google-Smtp-Source: APXvYqzewOOYpXHr6TwfqBJp66qsDKCZ6T2tZ+yYdGsot5ugTkZoJJxsOzcq0UIv2gBWSPT4UV/sgQ== X-Received: by 2002:a17:90a:380d:: with SMTP id w13mr20125681pjb.138.1561320370070; Sun, 23 Jun 2019 13:06:10 -0700 (PDT) Received: from ar135.iitr.ac.in ([103.37.200.213]) by smtp.gmail.com with ESMTPSA id 27sm8621882pgt.6.2019.06.23.13.06.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 23 Jun 2019 13:06:09 -0700 (PDT) From: Rohit Ashiwal To: rohit.ashiwal265@gmail.com Cc: git@vger.kernel.org, newren@gmail.com, t.gummerer@gmail.com, phillip.wood123@gmail.com, gitster@pobox.com, martin.agren@gmail.com Subject: [GSoC][PATCH v7 3/6] sequencer: rename reset_for_rollback to reset_merge Date: Mon, 24 Jun 2019 01:33:35 +0530 Message-Id: <20190623200338.17144-4-rohit.ashiwal265@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190623200338.17144-1-rohit.ashiwal265@gmail.com> References: <20190608191958.4593-1-rohit.ashiwal265@gmail.com> <20190623200338.17144-1-rohit.ashiwal265@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We are on a path to teach cherry-pick/revert how to skip commits. To achieve this, we could really make use of existing functions. reset_for_rollback is one such function, but the name does not intuitively suggest to use it to reset a merge, which it was born to perform see 539047c ("revert: introduce --abort to cancel a failed cherry-pick", 2011-11-23). Change the name to reset_merge to make it more intuitive. Signed-off-by: Rohit Ashiwal --- sequencer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sequencer.c b/sequencer.c index 0ef2622a69..cb856bcfc3 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2732,7 +2732,7 @@ static int rollback_is_safe(void) return oideq(&actual_head, &expected_head); } -static int reset_for_rollback(const struct object_id *oid) +static int reset_merge(const struct object_id *oid) { const char *argv[4]; /* reset --merge + NULL */ @@ -2754,7 +2754,7 @@ static int rollback_single_pick(struct repository *r) return error(_("cannot resolve HEAD")); if (is_null_oid(&head_oid)) return error(_("cannot abort from a branch yet to be born")); - return reset_for_rollback(&head_oid); + return reset_merge(&head_oid); } int sequencer_rollback(struct repository *r, struct replay_opts *opts) @@ -2797,7 +2797,7 @@ int sequencer_rollback(struct repository *r, struct replay_opts *opts) warning(_("You seem to have moved HEAD. " "Not rewinding, check your HEAD!")); } else - if (reset_for_rollback(&oid)) + if (reset_merge(&oid)) goto fail; strbuf_release(&buf); return sequencer_remove_state(opts);