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.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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 C29241F8C6 for ; Wed, 25 Aug 2021 19:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242460AbhHYTGI (ORCPT ); Wed, 25 Aug 2021 15:06:08 -0400 Received: from cloud.peff.net ([104.130.231.41]:59302 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241036AbhHYTGI (ORCPT ); Wed, 25 Aug 2021 15:06:08 -0400 Received: (qmail 31225 invoked by uid 109); 25 Aug 2021 19:05:21 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Wed, 25 Aug 2021 19:05:21 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 10791 invoked by uid 111); 25 Aug 2021 19:05:22 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Wed, 25 Aug 2021 15:05:22 -0400 Authentication-Results: peff.net; auth=none Date: Wed, 25 Aug 2021 15:05:20 -0400 From: Jeff King To: Elijah Newren Cc: Yuri , Git Mailing List Subject: Re: 'git pull' complains that a locally resurrected directory would be overwritten by merge when no pulled changes are affecting that directory Message-ID: References: <01514401-78f6-3fdc-aa74-c519fb6ab427@rawbw.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Aug 25, 2021 at 08:42:09AM -0700, Elijah Newren wrote: > > Is it possible to give us a more complete example, including: > > > > - a url for the repository > > - the commit at HEAD when you ran "git checkout" > > - the {hash} commit from which you rescued the files > > - the state of the remote branch (i.e., what we attempted to merge > > with "git pull") > > > > ? > > The `git checkout {hash}~1 -- math/polymake` is enough to highlight > that Yuri doesn't just have local changes (which the merge machinery > should allow if the incoming changes don't touch the same files), but > local *staged* changes. As per the merge manpage: > > """ > To avoid recording unrelated changes in the merge commit, git pull and > git merge will also abort if there are any changes registered in the > index relative to the HEAD commit. > """ Doh, you're right. I did a simple reproduction test, but in my example, the merge was a fast-forward, which we do allow. Picking a branch more carefully using: git for-each-ref --no-contains HEAD --no-merged HEAD refs/remotes/origin shows the error. Sorry for the confusion. -Peff