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,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 9528A1F8C6 for ; Tue, 31 Aug 2021 02:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239657AbhHaCRF (ORCPT ); Mon, 30 Aug 2021 22:17:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239646AbhHaCRF (ORCPT ); Mon, 30 Aug 2021 22:17:05 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF59AC061575 for ; Mon, 30 Aug 2021 19:16:10 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id v33-20020a0568300921b0290517cd06302dso20931721ott.13 for ; Mon, 30 Aug 2021 19:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=b4va2b3vM2kT+S/AbKvuS3H0QrLXqtByb7DQkBPy8UY=; b=k7nXD9/kXdtc9pSbYj0/18Ux7QySiwjcDwxJxzV+eAUZAUH4XepdWzX3nZgWSJwFzq ZVBhWaDFEglNd8MNZxLoJoVNqt6E45wJ5EVUGAIiLv4KGB83OTE3AF8+ixxfjd6Z4kdq 2awS/TR0MFCZblSO3HdfASYe97ZbdIgRwpPTDOces/32tIsTU2OR++ipIYxujAfkPehR ceAd4knOxYKLueAQ49fng7FFAwL+9yDEcDPsdFwfNvHQ+302HAkp07P+toeamctGYkvS y5nnbW76ieiYVYMfKo8whzyhvGasSp6nw8Zolm1rv0coAEfA3YtTMuCKym5uwEkrJOhW uiBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b4va2b3vM2kT+S/AbKvuS3H0QrLXqtByb7DQkBPy8UY=; b=uBM3lGvXXmoHL7kGUxWhQKu3Sbi3AUg6OF0chJB0Wp7hhoe1OYX773nrr1FsPTokpu RgLM6p3VE/0t6PWmzOK5c49mwWg1Xe8syoj6leO4vKdYyW9Z+L4TdMivO5yGJd0442Eq YS3rMqzMsOHL/gtzkrUt4SFbwQDNz99Vu1DQyZjiMor96hu3/K3gAz3XNP3x80V7wVpm LFaX8Kjx75rmD4g+LV+OJV+xYrfrGk91gARczPZMAQ3Q4ckRd905mUKTpes+04aG96BH JEX/uIt4XnNXHO9lOfmQpMp3jp+GVnfFKwSd7cQcXq6p5uc7yip8w3V3rK1uXHQ7zId2 y/Ew== X-Gm-Message-State: AOAM530t/x6b+LizddyYO4nJekM7cTzWDuPz/KX7h7h3q3F+tMaS8JZb tq7Roueyo9RNDtHAjvRzY3kO3F0akBEPkaxPCCs= X-Google-Smtp-Source: ABdhPJxQQ58u0UK9qUA/awm9cTVl42In+OCs+V2MXhW9lcNb8kegcETaHQNM80/fsqFjliL9b0sPdnQpO90s7h+h0JA= X-Received: by 2002:a05:6830:b8e:: with SMTP id a14mr21869166otv.162.1630376170054; Mon, 30 Aug 2021 19:16:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Elijah Newren Date: Mon, 30 Aug 2021 19:15:58 -0700 Message-ID: Subject: Re: Git re-creates newly added directory when it is pushed To: Junio C Hamano Cc: Yuri , Git Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sun, Aug 29, 2021 at 5:07 PM Junio C Hamano wrote: > > Elijah Newren writes: > > >> Why does Git have to delete and then create again the directory when it > >> is already there? > >> > >> > >> This isn't a big issue, but it is very odd that git deletes the working > >> directory. > > > > It was deleted by the rebase operation, because rebase (currently) > > works by first checking out the target commit onto which it will apply > > all your local patches. That target didn't have the directory; the > > directory was added by your local patches. So checking out that > > commit necessarily deletes the directory. Then rebase applies each of > > your local patches, one by one, updating the working directory as it > > applies them. Since your local patches create that directory, it gets > > re-created by this process. > > This is one of the reasons why "rebase" (especially "rebase -i") may > want to insist starting at the top-level of the working tree, like > "git bisect" does. Because running the command from a subdirectory > works most of the time until it doesn't, people tend to complain why > they should go up to the top-level before they can run the command. > > And this is why---it causes end-user confusion. Makes sense to me; I'll submit a patch.