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

Re: [PATCH] fix `git mv existing-dir non-existing-dir`*

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 8, 2023, 19:00 UTC
Message-ID
<xmqqttt9740q.fsf@gitster.g>
In-Reply-To
<xmqqy1il77wp.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> What is curious is that dest_st.st_mode, after lstat on dst
> succeeds, is never checked, even though the error message claims
> that it detected an attempt to move directory over file.  What
> should happen when the user did this then?
>
>     $ git mv existing-dir another-existing-dir
>
> Shouldn't it do something similar to
>
>     $ mv D1 D2
>
> which is to move the entire hierarchy of D1 and make it appear at
> D2/D1?

Ah, that case is handled in a different codepath, so this lstat of dst needs to check only the existence. So there is no (unrelated) bug there. Sorry for the noise.

Previous: Junio C HamanoNext: Torsten Bögershausen
Message 3 of 7 in “fix `git mv existing-dir non-existing-dir`*”
  1. fix `git mv existing-dir non-existing-dir`*Sebastian Thiel via GitGitGadget, Aug 8, 2023
  2. Junio C HamanoAug 8, 2023
  3. Junio C HamanoAug 8, 2023
  4. Torsten BögershausenAug 8, 2023
  5. Junio C HamanoAug 8, 2023
  6. mv: fix error for moving directory to anotherJunio C Hamano, Aug 12, 2023
  7. fix `git mv existing-dir non-existing-dir` in some environments.Sebastian Thiel via GitGitGadget, Aug 9, 2023

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.