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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D279C433F5 for ; Fri, 13 May 2022 12:57:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380477AbiEMM5I (ORCPT ); Fri, 13 May 2022 08:57:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380456AbiEMM5G (ORCPT ); Fri, 13 May 2022 08:57:06 -0400 Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 527089B186 for ; Fri, 13 May 2022 05:57:03 -0700 (PDT) Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 22CCE1A49D2; Fri, 13 May 2022 08:57:03 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:message-id:mime-version:content-type; s=sasl; bh=m06ObQ8j+UICxj+6qHPBNWTZK470Ml5yvPDeu5HqsIM=; b=bfOV vy6seMJ881dhVJczQe+G2C8YAh2QLtcXlLK5785XoBWlHjF4zcCkwmG1RldtXV8j N0zVIo/+PsOo1i0m7rCuE3IHViF6a8LA594pmSXQpzsO4SPqe8UHBP7GmUlySi1t NZLkT5cH4L6DSKIxGPfHjdxPauXCo/VfBZ+lAaE= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 1B5771A49D1; Fri, 13 May 2022 08:57:03 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.83.65.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id B94641A49CE; Fri, 13 May 2022 08:56:59 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Elijah Newren Cc: ZheNing Hu , Christian Couder , Git List , vascomalmeida@sapo.pt Subject: Re: Question about pre-merge and git merge octopus strategy References: Date: Fri, 13 May 2022 05:56:58 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 2D530E12-D2BC-11EC-806A-CBA7845BAAA9-77302942!pb-smtp21.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Elijah Newren writes: >> If merge-recursive or merge-resolve is asked to merge a single >> commit to the current branch without any other strategies to use as >> a fallback, they leave the working tree and index into a state where >> the end-user can conclude the conflict resolution and commit the >> result. In spirit, we are in the same situation, aren't we? > > I don't think it's quite the same.... > ... > Or are you saying that if all merge strategies return a 2, we just > treat the last one as good enough and consider the merge to be in > progress? No, I was just confusing the difference between the special return value 2 and a normal failure value 1. I have a feeling that it would be nice if we can restore to pristine on the calling "git merge" side, rather than forcing individual strategy backends to implement the restore-to-pristine correctly, but in any case, as you said, we should behave as if a merge strategy backend never run after it failed with exit value 2 by restoring to pristine state.