git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Elijah Newren <newren@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>, Jeff King <peff@peff.net>,
	Taylor Blau <me@ttaylorr.com>,
	Derrick Stolee <dstolee@microsoft.com>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Phillip Wood <phillip.wood123@gmail.com>
Subject: Re: en/keep-cwd (Was: Re: What's cooking in git.git (Dec 2021, #01; Fri, 3))
Date: Tue, 07 Dec 2021 10:17:53 +0100	[thread overview]
Message-ID: <211207.86ee6opy0f.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <CABPp-BGdvOhy_g8vtRogqL2vPkZEtP4+N_5x0rhAWrX9x43WWA@mail.gmail.com>


On Mon, Dec 06 2021, Elijah Newren wrote:

> On Mon, Dec 6, 2021 at 5:57 PM Junio C Hamano <gitster@pobox.com> wrote:
>>
>> * en/keep-cwd (2021-12-01) 11 commits
>>  - t2501: simplify the tests since we can now assume desired behavior
>>  - dir: new flag to remove_dir_recurse() to spare the original_cwd
>>  - dir: avoid incidentally removing the original_cwd in remove_path()
>>  - stash: do not attempt to remove startup_info->original_cwd
>>  - rebase: do not attempt to remove startup_info->original_cwd
>>  - clean: do not attempt to remove startup_info->original_cwd
>>  - symlinks: do not include startup_info->original_cwd in dir removal
>>  - unpack-trees: add special cwd handling
>>  - unpack-trees: refuse to remove startup_info->original_cwd
>>  - setup: introduce startup_info->original_cwd
>>  - t2501: add various tests for removing the current working directory
>>
>>  Many git commands that deal with working tree files try to remove a
>>  directory that becomes empty (i.e. "git switch" from a branch that
>>  has the directory to another branch that does not would attempt
>>  remove all files in the directory and the directory itself).  This
>>  drops users into an unfamiliar situation if the command was run in
>>  a subdirectory that becomes subject to removal due to the command.
>>  The commands have been taught to keep an empty directory if it is
>>  the directory they were started in to avoid surprising users.
>
> Very nicely written summary.
>
>>
>>  Needs review.
>>  There are some comments on earlier rounds; the latest one needs a
>>  serious review or at least Acks from past commentors.
>>  source: <pull.1140.v5.git.git.1638340854.gitgitgadget@gmail.com>
>
> If it helps, there are two parts to the review:
> - Do we want this feature?
> - Does this patch series implement the feature correctly?
> Let me mention both:
>
> Much of the discussion from commenters was actually related to the
> first point.  While Peff suggested the idea, and Taylor and Phillip
> (Wood) spoke up in favor (and I obviously cared enough to write
> patches), Ævar didn't like it at first.  After a lot of back and
> forth, we eventually discovered some misunderstanding after which
> Ævar, while still not a proponent, dropped his strong objection ("I'm
> much more sympathetic to this approach now."[1])  I was unable to
> determine the opinion of other reviewers/commenters on this point,
> though if I had to guess I'd say Junio is at least marginally in
> favor.

I just really wanted you to pick up & run with the "let's not die then"
WIP work I had, but I also want a pony. So ... :)

IOW I do think it would be really worthwhile to pull at the thread of
not dying, and I just find it a bit conceptually unclean to not /try/
and just die (or recover) on the actual OS error we get.

But I also think I'm just nitpicking / being overly pedantic there.

I can't really think of a realistic scenario where users will really
mind the behavior change you're introducing (in a bad way), but the "in
a good way" case is clearly something that addresses an actual problem.

So I've got no objections to these changes going in as they stand. If
anyone is interested in pulling at the "let's not make it die" thread
that can always be done later, or we can make it configurable or
whatever.

I don't think this needs to be part of your initial series, but just a
question:

Isn't a logical follow-up after it to change the various things like
"git bisect that refuse to run in subdirectories to happily do so?
I.e. the reason for those is specifically this "cwd goes away". Both
because of our bad handling of it, and due to any user confusion that'll
be addressed by that cwd sticking around".

  reply	other threads:[~2021-12-07  9:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-04  1:37 What's cooking in git.git (Dec 2021, #01; Fri, 3) Junio C Hamano
2021-12-06 19:13 ` Phillip Wood
2021-12-06 19:24   ` Junio C Hamano
2021-12-08 12:42   ` Johannes Schindelin
2021-12-09  1:02     ` Junio C Hamano
2021-12-09 10:39     ` Phillip Wood
2021-12-07  6:00 ` en/keep-cwd (Was: Re: What's cooking in git.git (Dec 2021, #01; Fri, 3)) Elijah Newren
2021-12-07  9:17   ` Ævar Arnfjörð Bjarmason [this message]
2021-12-07 20:33     ` Elijah Newren
2021-12-07 18:26   ` en/keep-cwd Junio C Hamano
2021-12-08 12:46   ` en/keep-cwd (Was: Re: What's cooking in git.git (Dec 2021, #01; Fri, 3)) Johannes Schindelin
2021-12-07 15:54 ` What's cooking in git.git (Dec 2021, #01; Fri, 3) Derrick Stolee
2021-12-07 19:37 ` cf/fetch-set-upstream-while-detached (was: What's cooking in git.git (Dec 2021, #01; Fri, 3)) Ævar Arnfjörð Bjarmason
2021-12-07 20:41   ` cf/fetch-set-upstream-while-detached Junio C Hamano
2021-12-07 22:04     ` [PATCH v5] pull, fetch: fix segfault in --set-upstream option Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=211207.86ee6opy0f.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    --cc=phillip.wood123@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).