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

Re: [PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 10, 2023, 00:59 UTC
Message-ID
<xmqqttqzuwah.fsf@gitster.g>
In-Reply-To
<xmqq1qe3wbt1.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> Regardless of the "do we require, or is it sifficient to imply, the
> '-p' option when we lack leading directories?" question, once we
> start "auto-creating" the leading directory hierarchy, one worrysome
> thing such a new feature introduces is an ambiguity and unexpected
> behaviour. ...
> Both are plausible, and "mkdir -p" does not have such a nasty
> ambiguity.  That is what makes me unsure about the new feature
> (again, either with required "-p" or with implied "-p").

I checked what POSIX, who does give "-p" to mkdir(1), has with mv(1), and they do not have "-p". Neither GNU, which tends to add such "usability" enhancements on top of what everybody else has.

And I think they are being very sensible. By not adding such an option to "mv", they can sidestep the unnecessary ambiguity, and it isn't too bad to do a "mkdir -p" separately before doing such a "mv" into a (potential) new directory.

So, let's not do this patch.
Thanks.
Previous: Junio C HamanoNext: Hugo Sales
Message 6 of 11 in “Add `-p' option to `git-mv', inspired by `mkdir'”
  1. 0/3 Add `-p' option to `git-mv', inspired by `mkdir'Hugo Sales, Oct 9, 2023
  2. 2/3 mv: Add tests for new -p flagHugo Sales, Oct 9, 2023
  3. 3/3 mv: Add documentation for new `-p' flagHugo Sales, Oct 9, 2023
  4. 1/3 mv: Add -p option to create parent directoriesHugo Sales, Oct 9, 2023
  5. Junio C HamanoOct 10, 2023
  6. Junio C HamanoOct 10, 2023
  7. Hugo SalesOct 11, 2023
  8. Junio C HamanoOct 31, 2023
  9. Dragan SimicOct 31, 2023
  10. Junio C HamanoOct 31, 2023
  11. Dragan SimicOct 31, 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.