From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 370B81F8C6 for ; Sun, 1 Aug 2021 10:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231527AbhHAKOp (ORCPT ); Sun, 1 Aug 2021 06:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbhHAKOo (ORCPT ); Sun, 1 Aug 2021 06:14:44 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5093C0613CF for ; Sun, 1 Aug 2021 03:14:35 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id k38-20020a05600c1ca6b029025af5e0f38bso807705wms.5 for ; Sun, 01 Aug 2021 03:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=dgfI50RcWG807HyVRiT4OpXwQE+QJBcRL3kqqGk19Ds=; b=hEfUvS5TuqCqFaFYaXRsAUWX7ngRjyil93o/aHrk1JYyPbN+WpPzIw3HnllARD6G8g eQAH+RKly7AOuP0BQcrbtfW44ISdeA6IAbDeN6q0o4M8AjxxrQm7+heK5XHficOUQjWW yASeng//DM8wflEsfRuGYZO4i5TPukvAuDLsjKO0RssUzR+eQGgx8vkRCMd+JWe0wzzo gHxeMSOfcXtQTrHE7iFGEwEj3m5aIc3qDddnV8Sjx1C2UrSnfCYX8n06auH9jZ8otbZf o7rfL4VsXZ2w6drM1cq0PnieXjE5SEXWkID7lyP4QjRzsR+uzS2Hjfqi2TXRbrbLVyvi cV3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=dgfI50RcWG807HyVRiT4OpXwQE+QJBcRL3kqqGk19Ds=; b=HKiAwQYipe8x4jc4KbOvl/D/rKXcRNXLpoerEVgf1DtDpXJz3G3RCLFINOgGZMMHdu iq5h6azD5ETRp0TDAhk1sg/ZHzZvwgKOX0x3acDkMtT1SpXPvoStYAgO1EB/Rf8H7wGP clJKdkrJ5S1STdDEIoJ8tGvfVnr/dggWMxAm0U63S9Rm8quQAoZaANqv2hYEtHXt69iO RqAoVKZOzCVPdhlQ9jdGyxoxqMdg5p/sP4+AeHm/npMu1NG6rFQUyQ7TFWn7ZNSJ5Dz+ u0+TGm4EyKHzc5I1/awyjcRytaUTYGjIz+0/2ityMsU8TuaJDQi4QUw5kxKSDof/pFyi Dqeg== X-Gm-Message-State: AOAM533TbCr8iFmLnkz6l55YMHOPzByY8wRv95EY8ut/wtcsNswVjQVx 84aULsbw1TMsxBsOq0fSDq8= X-Google-Smtp-Source: ABdhPJzs0qOPET0wo9BLUssbQxpdoPeumNDFu8Vzgtnpm/gJhVQv283WY14gRaTPiCnzOO89J8wlFA== X-Received: by 2002:a05:600c:4e94:: with SMTP id f20mr11397430wmq.135.1627812874234; Sun, 01 Aug 2021 03:14:34 -0700 (PDT) Received: from [192.168.1.14] (host-2-98-21-22.as13285.net. [2.98.21.22]) by smtp.gmail.com with ESMTPSA id d15sm441413wri.96.2021.08.01.03.14.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Aug 2021 03:14:33 -0700 (PDT) Reply-To: phillip.wood@dunelm.org.uk Subject: Re: [PATCH 2/2] [GSOC] cherry-pick: use better advice message To: ZheNing Hu via GitGitGadget , git@vger.kernel.org Cc: Junio C Hamano , Christian Couder , Hariom Verma , =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Han-Wen Nienhuys , Ramkumar Ramachandra , Felipe Contreras , ZheNing Hu References: <7e1ed49728df8dab771d77f1a076f0fa30975718.1627714878.git.gitgitgadget@gmail.com> From: Phillip Wood Message-ID: <0a2ab793-de4d-d8d1-4d1d-a018fa0f252c@gmail.com> Date: Sun, 1 Aug 2021 11:14:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <7e1ed49728df8dab771d77f1a076f0fa30975718.1627714878.git.gitgitgadget@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 31/07/2021 08:01, ZheNing Hu via GitGitGadget wrote: > From: ZheNing Hu > > In the past, git cherry-pick would print such advice when > there was a conflict: > > hint: after resolving the conflicts, mark the corrected paths > hint: with 'git add ' or 'git rm ' > hint: and commit the result with 'git commit' > > But in fact, when we want to cherry-pick multiple commits, > we should not use "git commit" after resolving conflicts, which > will make Git generate some errors. We should recommend users to > use `git cherry-pick --continue`, `git cherry-pick --abort`, just > like git rebase does. > > This is the improved advice: > > hint: Resolve all conflicts manually, mark them as resolved with > hint: "git add/rm ", then run "git cherry-pick \ > --continue". > hint: You can instead skip this commit: run "git cherry-pick --skip". > hint: To abort and get back to the state before "git cherry-pick", > hint: run "git cherry-pick --abort". This new wording matches what we have for rebase which is good, I am slightly worried that the lines end up being quite long though they are just under 80 characters. It might be worth splitting the line that mentions running "git cherry-pick --continue" so it is a bit shorter. Best Wishes Phillip > Mentored-by: Christian Couder > Mentored-by Hariom Verma : > Helped-by: Phillip Wood > Hepled-by: Junio C Hamano > Signed-off-by: ZheNing Hu > --- > sequencer.c | 9 ++++++++- > t/t3507-cherry-pick-conflict.sh | 15 ++++++++++----- > 2 files changed, 18 insertions(+), 6 deletions(-) > > diff --git a/sequencer.c b/sequencer.c > index 83cf6a5da3c..f6e9d1fddd8 100644 > --- a/sequencer.c > +++ b/sequencer.c > @@ -404,7 +404,14 @@ static void print_advice(struct replay_opts *opts, int show_hint) > if (msg) { > advise("%s\n", msg); > } else if (show_hint) { > - if (opts->no_commit) > + if (opts->action == REPLAY_PICK) { > + advise(_("Resolve all conflicts manually, mark them as resolved with\n" > + "\"git add/rm \", then run \"git cherry-pick --continue\".\n" > + "You can instead skip this commit: run \"git cherry-pick --skip\".\n" > + "To abort and get back to the state before \"git cherry-pick\",\n" > + "run \"git cherry-pick --abort\".")); > + > + } else if (opts->no_commit) > advise(_("after resolving the conflicts, mark the corrected paths\n" > "with 'git add ' or 'git rm '")); > else > diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh > index f17621d1915..2cc3977f5a6 100755 > --- a/t/t3507-cherry-pick-conflict.sh > +++ b/t/t3507-cherry-pick-conflict.sh > @@ -53,9 +53,11 @@ test_expect_success 'advice from failed cherry-pick' " > picked=\$(git rev-parse --short picked) && > cat <<-EOF >expected && > error: could not apply \$picked... picked > - hint: after resolving the conflicts, mark the corrected paths > - hint: with 'git add ' or 'git rm ' > - hint: and commit the result with 'git commit' > + hint: Resolve all conflicts manually, mark them as resolved with > + hint: \"git add/rm \", then run \"git cherry-pick --continue\". > + hint: You can instead skip this commit: run \"git cherry-pick --skip\". > + hint: To abort and get back to the state before \"git cherry-pick\", > + hint: run \"git cherry-pick --abort\". > EOF > test_must_fail git cherry-pick picked 2>actual && > > @@ -68,8 +70,11 @@ test_expect_success 'advice from failed cherry-pick --no-commit' " > picked=\$(git rev-parse --short picked) && > cat <<-EOF >expected && > error: could not apply \$picked... picked > - hint: after resolving the conflicts, mark the corrected paths > - hint: with 'git add ' or 'git rm ' > + hint: Resolve all conflicts manually, mark them as resolved with > + hint: \"git add/rm \", then run \"git cherry-pick --continue\". > + hint: You can instead skip this commit: run \"git cherry-pick --skip\". > + hint: To abort and get back to the state before \"git cherry-pick\", > + hint: run \"git cherry-pick --abort\". > EOF > test_must_fail git cherry-pick --no-commit picked 2>actual && > >