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

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

From
HSHugo Sales <hugo@hsal.es>
Date
Oct 9, 2023, 23:34 UTC
Message-ID
<20231009233458.1371351-1-hugo@hsal.es>

Allow passing a new `-p'/`--parents' option to `git-mv' making it so missing directories in the given target path get created if they don't exist. This allows running `git mv -p foo bar/quux/' to first create the `bar/' and `bar/quux/' directories if they don't exist, and then move `foo' to `bar/quux/foo'.

This is inspired by `mkdir -p foo/bar/quux/' which will create the `foo/', `foo/bar/', and `foo/bar/quux/' directories if they don't exist.

Hugo Sales (3):
  mv: Add -p option to create parent directories
  mv: Add tests for new -p flag
  mv: Add documentation for new `-p' flag
 Documentation/git-mv.txt | 12 ++++--
 builtin/mv.c             | 27 +++++++++-----
 t/t7009-mv-parents.sh    | 79 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 105 insertions(+), 13 deletions(-)
 create mode 100755 t/t7009-mv-parents.sh
base-commit: 3a06386e314565108ad56a9bdb8f7b80ac52fb69
-- 
2.42.0
Next: Hugo Sales
Message 1 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.