git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Is git-checkout's restoring d/f conflict really sane?

From
Junio C Hamano <gitster@pobox.com>
Date
May 15, 2019, 01:56 UTC
Message-ID
<xmqq1s108opt.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CACsJy8DoxHoi0H3R91ovqDPjk0tN3Rr8fQOjaLt_2P9O3n9b_g@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
> Technically 'one' is still tracked (even if it's a directory) so what
> we're doing is right. I'm just not sure if there's some big surprise
> factor here. And whether it's better to pause and double check with
> the user before deleting everything.

I agree to all of the above, including the part "technically it is correct", but more importantly "stop and double check".

As changing between a directory and a non-directory is a rare event anyway, I do not mind making it a bit more cumbersome and say "you asked me to check out a regular file 'one', but you have a directory 'one', that has an unignored untracked file in it, so I'd refuse to do so. Come back after you removed them manually, or use the '--force' option".

We should not refuse if 'one' is an empty directory or all files in it are ignored, though.

Thanks.
Previous: Duy Nguyen
Message 4 of 4 in “Is git-checkout's restoring d/f conflict really sane?”
  1. Duy NguyenMay 14, 2019
  2. Junio C HamanoMay 14, 2019
  3. Duy NguyenMay 14, 2019
  4. Junio C HamanoMay 15, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.