{"thread":{"id":"60335","subject":"[PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'","startedAt":"2023-10-09T23:35:20Z","lastAt":"2023-10-31T06:38:25Z","messageCount":11,"participants":["Hugo Sales","Junio C Hamano","Dragan Simic"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"482938","messageId":"20231009233458.1371351-1-hugo@hsal.es","threadId":"60335","inReplyTo":null,"subject":"[PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'","fromName":"Hugo Sales","fromEmail":"hugo@hsal.es","sentAt":"2023-10-09T23:34:55Z","receivedAt":"2023-10-09T23:35:20Z","isPatch":true,"sender":{"key":"hugo@hsal.es","avatar":null},"body":"Allow passing a new `-p'/`--parents' option to `git-mv' making it so\nmissing directories in the given target path get created if they don't\nexist. This allows running `git mv -p foo bar/quux/' to first create\nthe `bar/' and `bar/quux/' directories if they don't exist, and then\nmove `foo' to `bar/quux/foo'.\n\nThis is inspired by `mkdir -p foo/bar/quux/' which will create the\n`foo/', `foo/bar/', and `foo/bar/quux/' directories if they don't\nexist.\n\nHugo Sales (3):\n  mv: Add -p option to create parent directories\n  mv: Add tests for new -p flag\n  mv: Add documentation for new `-p' flag\n\n Documentation/git-mv.txt | 12 ++++--\n builtin/mv.c             | 27 +++++++++-----\n t/t7009-mv-parents.sh    | 79 ++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 105 insertions(+), 13 deletions(-)\n create mode 100755 t/t7009-mv-parents.sh\n\n\nbase-commit: 3a06386e314565108ad56a9bdb8f7b80ac52fb69\n-- \n2.42.0\n\n"},{"id":"482939","messageId":"20231009233458.1371351-3-hugo@hsal.es","threadId":"60335","inReplyTo":"20231009233458.1371351-1-hugo@hsal.es","subject":"[PATCH 2/3] mv: Add tests for new -p flag","fromName":"Hugo Sales","fromEmail":"hugo@hsal.es","sentAt":"2023-10-09T23:34:57Z","receivedAt":"2023-10-09T23:35:21Z","isPatch":true,"sender":{"key":"hugo@hsal.es","avatar":null},"body":"Signed-off-by: Hugo Sales <hugo@hsal.es>\n---\n t/t7009-mv-parents.sh | 79 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 79 insertions(+)\n create mode 100755 t/t7009-mv-parents.sh\n\ndiff --git a/t/t7009-mv-parents.sh b/t/t7009-mv-parents.sh\nnew file mode 100755\nindex 0000000000..cc1d9dae08\n--- /dev/null\n+++ b/t/t7009-mv-parents.sh\n@@ -0,0 +1,79 @@\n+#!/bin/sh\n+\n+test_description='git mv -p'\n+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main\n+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'mv fails to move a file if the target directory does not exist' '\n+\techo test >test1 &&\n+\tgit add test1 &&\n+\ttest_must_fail git mv test1 foo/\n+'\n+\n+test_expect_success 'mv fails to move multiple files if the target directory does not exist' '\n+\techo test >test2-1 &&\n+\techo test >test2-2 &&\n+\tgit add test2-1 test2-2 &&\n+\ttest_must_fail git mv test2-1 test2-2 foo/\n+'\n+\n+test_expect_success 'mv fails to move a file if the target refers to a file in a directory that does not exist' '\n+\techo test >test3 &&\n+\tgit add test3 &&\n+\ttest_must_fail git mv test3 foo/test3.txt\n+'\n+\n+test_expect_success 'mv succeeds to move a file even if the target directory does not exist' '\n+\techo test >test4 &&\n+\tgit add test4 &&\n+\tgit commit -m test4-commit1 &&\n+\tgit mv -p test4 dir4/ &&\n+\tgit commit -m test4-commit2 &&\n+\tgit diff-tree -r -M --name-status HEAD^ HEAD >test4-actual &&\n+\tgrep \"^R100..*test4..*dir4/test4\" test4-actual\n+'\n+\n+test_expect_success 'mv succeeds to move multiple files even if the target directory does not exist' '\n+\techo test >test5-1 &&\n+\techo test >test5-2 &&\n+\tgit add test5-1 test5-2 &&\n+\tgit commit -m test5-commit1 &&\n+\tgit mv -p test5-1 test5-2 dir5/ &&\n+\tgit commit -m test5-commit2 &&\n+\tgit diff-tree -r -M --name-status HEAD^ HEAD >test5-actual &&\n+\tgrep -e \"^R100..*test5-1..*dir5/test5-1\" -e \"^R100..*test5-2..*dir5/test5-2\" test5-actual\n+'\n+\n+test_expect_success 'mv succeeds to move a file even if the target refers to a file in a directory that does not exist' '\n+\techo test >test6 &&\n+\tgit add test6 &&\n+\tgit commit -m test6-commmit-1 &&\n+\tgit mv -p test6 dir6/test6.txt &&\n+\tgit commit -m test6-commit2 &&\n+\tgit diff-tree -r -M --name-status HEAD^ HEAD >test6-actual &&\n+\tgrep \"^R100..*test6..*dir6/test6.txt\" test6-actual\n+'\n+\n+test_expect_success 'mv succeeds to move a file even if the target refers to a file in a directory inside a directory that does not exist' '\n+\techo test >test7 &&\n+\tgit add test7 &&\n+\tgit commit -m test7-commit1 &&\n+\tgit mv -p test7 dir7/dir7/test7.txt &&\n+\tgit commit -m test7-commit2 &&\n+\tgit diff-tree -r -M --name-status HEAD^ HEAD >test7-actual &&\n+\tgrep \"^R100..*test7..*dir7/dir7/test7.txt\" test7-actual\n+'\n+\n+test_expect_success 'mv succeeds to move a file even if the target refers to a file in a directory inside a directory inside a directory that does not exist' '\n+\techo test >test8 &&\n+\tgit add test8 &&\n+\tgit commit -m test8-commit1 &&\n+\tgit mv -p test8 dir8/dir8/dir8/test8.txt &&\n+\tgit commit -m test8-commit2 &&\n+\tgit diff-tree -r -M --name-status HEAD^ HEAD >test8-actual &&\n+\tgrep \"^R100..*test8..*dir8/dir8/dir8/test8.txt\" test8-actual\n+'\n+\n+test_done\n-- \n2.42.0\n\n"},{"id":"482940","messageId":"20231009233458.1371351-4-hugo@hsal.es","threadId":"60335","inReplyTo":"20231009233458.1371351-1-hugo@hsal.es","subject":"[PATCH 3/3] mv: Add documentation for new `-p' flag","fromName":"Hugo Sales","fromEmail":"hugo@hsal.es","sentAt":"2023-10-09T23:34:58Z","receivedAt":"2023-10-09T23:35:22Z","isPatch":true,"sender":{"key":"hugo@hsal.es","avatar":null},"body":"Signed-off-by: Hugo Sales <hugo@hsal.es>\n---\n Documentation/git-mv.txt | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-mv.txt b/Documentation/git-mv.txt\nindex fb0220fd18..70c1e9572c 100644\n--- a/Documentation/git-mv.txt\n+++ b/Documentation/git-mv.txt\n@@ -15,13 +15,14 @@ DESCRIPTION\n -----------\n Move or rename a file, directory or symlink.\n \n- git mv [-v] [-f] [-n] [-k] <source> <destination>\n- git mv [-v] [-f] [-n] [-k] <source> ... <destination directory>\n+ git mv [-v] [-f] [-n] [-k] [-p] <source> <destination>\n+ git mv [-v] [-f] [-n] [-k] [-p] <source> ... <destination directory>\n \n In the first form, it renames <source>, which must exist and be either\n a file, symlink or directory, to <destination>.\n-In the second form, the last argument has to be an existing\n-directory; the given sources will be moved into this directory.\n+In the second form, the last argument refers to a directory, which has\n+to exist unless -p is specified, in which case it gets created; the\n+given sources will be moved into this directory.\n \n The index is updated after successful completion, but the change must still be\n committed.\n@@ -39,6 +40,9 @@ OPTIONS\n -n::\n --dry-run::\n \tDo nothing; only show what would happen\n+-p::\n+--parents::\n+\tCreate missing parent directories in the <destination> or <destination directory> path. Similar to `mkdir -p', all missing leading directories are created.\n \n -v::\n --verbose::\n-- \n2.42.0\n\n"},{"id":"482941","messageId":"20231009233458.1371351-2-hugo@hsal.es","threadId":"60335","inReplyTo":"20231009233458.1371351-1-hugo@hsal.es","subject":"[PATCH 1/3] mv: Add -p option to create parent directories","fromName":"Hugo Sales","fromEmail":"hugo@hsal.es","sentAt":"2023-10-09T23:34:56Z","receivedAt":"2023-10-09T23:35:23Z","isPatch":true,"sender":{"key":"hugo@hsal.es","avatar":null},"body":"Inspired by \"mkdir -p\", this patch allows specifying a \"-p\" or\n\"--parents\" flag which will create all non-existent directories in the\ndestination path before renaming the file.\n\nThis allows the user to not have to run two commands to move files to a\nnew directory.\n\nSigned-off-by: Hugo Sales <hugo@hsal.es>\n---\n builtin/mv.c | 27 ++++++++++++++++++---------\n 1 file changed, 18 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex c596515ad0..5d64d86179 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -168,7 +168,7 @@ static int empty_dir_has_sparse_contents(const char *name)\n int cmd_mv(int argc, const char **argv, const char *prefix)\n {\n \tint i, flags, gitmodules_modified = 0;\n-\tint verbose = 0, show_only = 0, force = 0, ignore_errors = 0, ignore_sparse = 0;\n+\tint verbose = 0, show_only = 0, force = 0, ignore_errors = 0, ignore_sparse = 0, create_parents = 0;\n \tstruct option builtin_mv_options[] = {\n \t\tOPT__VERBOSE(&verbose, N_(\"be verbose\")),\n \t\tOPT__DRY_RUN(&show_only, N_(\"dry run\")),\n@@ -176,6 +176,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\t   PARSE_OPT_NOCOMPLETE),\n \t\tOPT_BOOL('k', NULL, &ignore_errors, N_(\"skip move/rename errors\")),\n \t\tOPT_BOOL(0, \"sparse\", &ignore_sparse, N_(\"allow updating entries outside of the sparse-checkout cone\")),\n+\t\tOPT_BOOL('p', \"parents\", &create_parents, N_(\"create missing parent directories\")),\n \t\tOPT_END(),\n \t};\n \tconst char **source, **destination, **dest_path, **submodule_gitfile;\n@@ -220,8 +221,8 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \tif (dest_path[0][0] == '\\0')\n \t\t/* special case: \".\" was normalized to \"\" */\n \t\tdestination = internal_prefix_pathspec(dest_path[0], argv, argc, DUP_BASENAME);\n-\telse if (!lstat(dest_path[0], &st) &&\n-\t\t\tS_ISDIR(st.st_mode)) {\n+\telse if (create_parents ||\n+\t\t (!lstat(dest_path[0], &st) && S_ISDIR(st.st_mode))) {\n \t\tdestination = internal_prefix_pathspec(dst_w_slash, argv, argc, DUP_BASENAME);\n \t} else {\n \t\tif (!path_in_sparse_checkout(dst_w_slash, &the_index) &&\n@@ -381,7 +382,8 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\t\tbad = _(\"multiple sources for the same target\");\n \t\t\tgoto act_on_entry;\n \t\t}\n-\t\tif (is_dir_sep(dst[strlen(dst) - 1])) {\n+\n+\t\tif (!create_parents && is_dir_sep(dst[strlen(dst) - 1])) {\n \t\t\tbad = _(\"destination directory does not exist\");\n \t\t\tgoto act_on_entry;\n \t\t}\n@@ -459,11 +461,18 @@ int cmd_mv(int argc, const char **argv, const char *prefix)\n \t\tif (show_only)\n \t\t\tcontinue;\n \t\tif (!(mode & (INDEX | SPARSE | SKIP_WORKTREE_DIR)) &&\n-\t\t    !(dst_mode & (SKIP_WORKTREE_DIR | SPARSE)) &&\n-\t\t    rename(src, dst) < 0) {\n-\t\t\tif (ignore_errors)\n-\t\t\t\tcontinue;\n-\t\t\tdie_errno(_(\"renaming '%s' failed\"), src);\n+\t\t    !(dst_mode & (SKIP_WORKTREE_DIR | SPARSE))) {\n+\t\t\tif (create_parents && safe_create_leading_directories_const(dst) < 0) {\n+\t\t\t\tif (ignore_errors)\n+\t\t\t\t\tcontinue;\n+\t\t\t\tdie_errno(_(\"creating parent directories for '%s' failed\"), dst);\n+\t\t\t}\n+\n+\t\t\tif (rename(src, dst) < 0) {\n+\t\t\t\tif (ignore_errors)\n+\t\t\t\t\tcontinue;\n+\t\t\t\tdie_errno(_(\"renaming '%s' failed\"), src);\n+\t\t\t}\n \t\t}\n \t\tif (submodule_gitfile[i]) {\n \t\t\tif (!update_path_in_gitmodules(src, dst))\n-- \n2.42.0\n\n"},{"id":"482944","messageId":"xmqq1qe3wbt1.fsf@gitster.g","threadId":"60335","inReplyTo":"20231009233458.1371351-1-hugo@hsal.es","subject":"Re: [PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-10-10T00:39:22Z","receivedAt":"2023-10-10T00:39:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hugo Sales <hugo@hsal.es> writes:\n\n> Allow passing a new `-p'/`--parents' option to `git-mv' making it so\n> missing directories in the given target path get created if they don't\n> exist. This allows running `git mv -p foo bar/quux/' to first create\n> the `bar/' and `bar/quux/' directories if they don't exist, and then\n> move `foo' to `bar/quux/foo'.\n>\n> This is inspired by `mkdir -p foo/bar/quux/' which will create the\n> `foo/', `foo/bar/', and `foo/bar/quux/' directories if they don't\n> exist.\n\nI'll step back and ask a related design question without reading the\npatches (yet).\n\nIs there a reason why somebody benefits by us retaining the current\nbehaviour, where\n\n    $ git mv file no/such/dir/yet/file\n\nfails with \"No such file or directory\", and they are forced to say\neither\n\n    $ mkdir -p no/such/dir/yet\n    $ git mv file no/such/dir/yet/file\n\nor\n\n    $ git mv -p file no/such/dir/yet/file\n\nYes, what I am getting at is if it makes sense to just \"fix\" the\nbehaviour of \"git mv\" about missing leading directories and do what\nthe end-user wanted to do without requiring \"-p\".\n\nRegardless of the \"do we require, or is it sifficient to imply, the\n'-p' option when we lack leading directories?\" question, once we\nstart \"auto-creating\" the leading directory hierarchy, one worrysome\nthing such a new feature introduces is an ambiguity and unexpected\nbehaviour.  Imagine there is no \"no\" directory (so nothing under it\nexists), and you did this (you do have a regular file \"file\").\n\n    $ git mv [-p] file no/such/dir/yet\n\nWhat should happen?  Would we do the equivalent of\n\n    $ mkdir -p no/such/dir && git mv file no/such/dir/yet\n\nor are we doing\n\n    $ mkdir -p no/such/dir/yet && git mv file no/such/dir/yet/file\n\nBoth are plausible, and \"mkdir -p\" does not have such a nasty\nambiguity.  That is what makes me unsure about the new feature\n(again, either with required \"-p\" or with implied \"-p\").\n\nThanks.\n"},{"id":"482946","messageId":"xmqqttqzuwah.fsf@gitster.g","threadId":"60335","inReplyTo":"xmqq1qe3wbt1.fsf@gitster.g","subject":"Re: [PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-10-10T00:59:50Z","receivedAt":"2023-10-10T00:59:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Regardless of the \"do we require, or is it sifficient to imply, the\n> '-p' option when we lack leading directories?\" question, once we\n> start \"auto-creating\" the leading directory hierarchy, one worrysome\n> thing such a new feature introduces is an ambiguity and unexpected\n> behaviour. ...\n> Both are plausible, and \"mkdir -p\" does not have such a nasty\n> ambiguity.  That is what makes me unsure about the new feature\n> (again, either with required \"-p\" or with implied \"-p\").\n\nI checked what POSIX, who does give \"-p\" to mkdir(1), has with\nmv(1), and they do not have \"-p\".  Neither GNU, which tends to add\nsuch \"usability\" enhancements on top of what everybody else has.\n\nAnd I think they are being very sensible.  By not adding such an\noption to \"mv\", they can sidestep the unnecessary ambiguity, and it\nisn't too bad to do a \"mkdir -p\" separately before doing such a \"mv\"\ninto a (potential) new directory.\n\nSo, let's not do this patch.\n\nThanks.\n\n"},{"id":"483043","messageId":"1384513657.119681.1697027599941@office.mailbox.org","threadId":"60335","inReplyTo":"xmqq1qe3wbt1.fsf@gitster.g","subject":"Re: [PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'","fromName":"Hugo Sales","fromEmail":"hugo@hsal.es","sentAt":"2023-10-11T12:33:19Z","receivedAt":"2023-10-11T12:33:29Z","isPatch":true,"sender":{"key":"hugo@hsal.es","avatar":null},"body":"> On 10/10/2023 12:39 AM GMT Junio C Hamano <gitster@pobox.com> wrote:\n> \n> Is there a reason why somebody benefits by us retaining the current\n> behaviour, where\n> \n>     $ git mv file no/such/dir/yet/file\n> \n> fails with \"No such file or directory\", and they are forced to say\n> either\n> \n>     $ mkdir -p no/such/dir/yet\n>     $ git mv file no/such/dir/yet/file\n> \n> or\n> \n>     $ git mv -p file no/such/dir/yet/file\n\nSomewhat, as it could be a typo, so if you actually want to create a new folder, you have to be explicit. I wouldn't be opposed to removing the need for the flag, but if we did, I think we should warn the user that a new directory was created.\n\n> Imagine there is no \"no\" directory (so nothing under it\n> exists), and you did this (you do have a regular file \"file\").\n> \n>     $ git mv [-p] file no/such/dir/yet\n> \n> What should happen?  Would we do the equivalent of\n> \n>     $ mkdir -p no/such/dir && git mv file no/such/dir/yet\n> \n> or are we doing\n> \n>     $ mkdir -p no/such/dir/yet && git mv file no/such/dir/yet/file\n> \n> Both are plausible, and \"mkdir -p\" does not have such a nasty\n> ambiguity.  That is what makes me unsure about the new feature\n> (again, either with required \"-p\" or with implied \"-p\").\n\nI think the ambiguity is resolved by the inclusion of lack thereof of a trailing `/`. This is what the implementation already does, too, before this patch. So\n\n     $ git mv [-p] file no/such/dir/yet\n\nwould be the same as\n\n     $ mkdir -p no/such/dir && git mv file no/such/dir/yet\n\nand\n\n     $ git mv [-p] file no/such/dir/yet/\n\nwould be the same as\n\n     $ mkdir -p no/such/dir/yet && git mv file no/such/dir/yet/\n\nMoving `file` to `no/such/dir/yet/file`\n\nThanks for the feedback,\nHugo\n\nP.S. Apologies for the duplicated email, Junio, I did a Reply instead of a Reply All\n"},{"id":"484178","messageId":"xmqqlebj4dnt.fsf@gitster.g","threadId":"60335","inReplyTo":"1384513657.119681.1697027599941@office.mailbox.org","subject":"Re: [PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-10-31T04:30:14Z","receivedAt":"2023-10-31T04:30:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Hugo Sales <hugo@hsal.es> writes:\n\n>> Both are plausible, and \"mkdir -p\" does not have such a nasty\n>> ambiguity.  That is what makes me unsure about the new feature\n>> (again, either with required \"-p\" or with implied \"-p\").\n>\n> I think the ambiguity is resolved by the inclusion of lack thereof\n> of a trailing `/`.\n\nThe question is not if we can come up with a rule that the user can\nuse to disambiguate.  It is if the user will find that such a rule\nis a naturally acceptable way to disambiguate.\n\nWhen both of\n\n    git mv file there/exists/such/a/directory\n    git mv file there/exists/such/a/directory/\n\ncreate \"there/exists/such/a/directory/file\" and removes \"file\", with\nor without a trailing slash, \"you should add a slash if you want a\ndirectory, and otherwise you should not add a slash\" is a rather\narbitrary rule.  Let's not go there.  I still view the downside more\ngrave than having to occasionally do \"mkdir\".\n"},{"id":"484181","messageId":"ffbb04b363938e4a487906134ce4f3c6@manjaro.org","threadId":"60335","inReplyTo":"xmqqlebj4dnt.fsf@gitster.g","subject":"Re: [PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2023-10-31T04:54:31Z","receivedAt":"2023-10-31T04:54:35Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2023-10-31 05:30, Junio C Hamano wrote:\n> Hugo Sales <hugo@hsal.es> writes:\n> \n>>> Both are plausible, and \"mkdir -p\" does not have such a nasty\n>>> ambiguity.  That is what makes me unsure about the new feature\n>>> (again, either with required \"-p\" or with implied \"-p\").\n>> \n>> I think the ambiguity is resolved by the inclusion of lack thereof\n>> of a trailing `/`.\n> \n> The question is not if we can come up with a rule that the user can\n> use to disambiguate.  It is if the user will find that such a rule\n> is a naturally acceptable way to disambiguate.\n> \n> When both of\n> \n>     git mv file there/exists/such/a/directory\n>     git mv file there/exists/such/a/directory/\n> \n> create \"there/exists/such/a/directory/file\" and removes \"file\", with\n> or without a trailing slash, \"you should add a slash if you want a\n> directory, and otherwise you should not add a slash\" is a rather\n> arbitrary rule.  Let's not go there.  I still view the downside more\n> grave than having to occasionally do \"mkdir\".\n\nPlease note that the above-described git-mv operation succeeds with no \ntrailing slash if \"there/exists/such/a/directory\" doesn't already exist \nas a directory, and creates \"there/exists/such/a/directory\" as a file.  \nWith the trailing slash, the git-mv operation succeeds only if \n\"there/exists/such/a/directory\" already exists as a directory, and fails \notherwise.\n\nA quite similar ambiguity exists in cp(1) in mv(1), which is also \nresolved by the use of the trailing slash character.  However, I've \nencountered only one person aware of that disambiguation, and in cp(1) \nonly, but in the \"I always include the trailing slash\" way, without \nactually understanding it fully.  Maybe I need to encounter more people, \nI don't know.\n"},{"id":"484195","messageId":"xmqq5y2n49la.fsf@gitster.g","threadId":"60335","inReplyTo":"ffbb04b363938e4a487906134ce4f3c6@manjaro.org","subject":"Re: [PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-10-31T05:58:09Z","receivedAt":"2023-10-31T06:18:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dragan Simic <dsimic@manjaro.org> writes:\n\n> A quite similar ambiguity exists in cp(1) in mv(1), which is also\n> resolved by the use of the trailing slash character.  However, I've\n> encountered only one person aware of that disambiguation, and in cp(1)\n> only, but in the \"I always include the trailing slash\" way, without\n> actually understanding it fully.  Maybe I need to encounter more\n> people, I don't know.\n\nIf the majority of (perhaps new) users you already know find such\ndisambiguation method unfamiliar, that already is a good anecdata\nwithout any need for you to meet more people to tell us that it is\nnot a very easy-to-understand thing for them, no?\n"},{"id":"484200","messageId":"245b1be0fcee3ade2d477fa1378647b8@manjaro.org","threadId":"60335","inReplyTo":"xmqq5y2n49la.fsf@gitster.g","subject":"Re: [PATCH 0/3] Add `-p' option to `git-mv', inspired by `mkdir'","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2023-10-31T06:38:21Z","receivedAt":"2023-10-31T06:38:25Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2023-10-31 06:58, Junio C Hamano wrote:\n> Dragan Simic <dsimic@manjaro.org> writes:\n> \n>> A quite similar ambiguity exists in cp(1) in mv(1), which is also\n>> resolved by the use of the trailing slash character.  However, I've\n>> encountered only one person aware of that disambiguation, and in cp(1)\n>> only, but in the \"I always include the trailing slash\" way, without\n>> actually understanding it fully.  Maybe I need to encounter more\n>> people, I don't know.\n> \n> If the majority of (perhaps new) users you already know find such\n> disambiguation method unfamiliar, that already is a good anecdata\n> without any need for you to meet more people to tell us that it is\n> not a very easy-to-understand thing for them, no?\n\nQuite frankly, I'm divided there.  On the one hand, you're right that \nthis disambiguation method is a bit confusing and it's absolutely not \nvery well known.  On the other hand, it's already out there in the wild, \nincluding git, and it's actually quite useful when used properly.\n\nIf I had to vote, I'd give my vote to embracing this disambiguation \nmethod, but only with good documentation and some kind of education \nthrough an article or two.  I believe that proper education simply isn't \npresent, or at least not in a user-friendly manner, which should be \ncorrected, regardless of the new \"git mv -p\" feature being accepted or \nnot.\n"}]}