{"thread":{"id":"64807","subject":"git subtree -P path split [rev] should check for path under rev, not in the current working directory","startedAt":"2026-01-15T04:43:11Z","lastAt":"2026-01-15T04:43:11Z","messageCount":1,"participants":["book lv"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"533916","messageId":"CAFePT4xDGegpEFuFemCXsH890E2WXnG3JzUZeiLi9KW8D8beOg@mail.gmail.com","threadId":"64807","inReplyTo":null,"subject":"git subtree -P path split [rev] should check for path under rev, not in the current working directory","fromName":"book lv","fromEmail":"thebookofunknowable@gmail.com","sentAt":"2026-01-15T04:42:59Z","receivedAt":"2026-01-15T04:43:11Z","isPatch":false,"sender":{"key":"thebookofunknowable@gmail.com","avatar":null},"body":"Hello Git Developers,\n\nI encountered an issue while using the command `git subtree -P path\nsplit [rev]` to extract a subdirectory from a local branch (which was\nnot checked out). Due to paths in that branch that cannot be handled\non Windows, I was unable to check it out. However, the specific folder\nI intended to process did not contain any problematic paths, so I\nplanned to split it into a separate repository for further work.\n\nDuring the operation, I received an error:\nfatal: 'path' does not exist; use 'git subtree add'\n\nHowever, I confirmed via git ls-tree that the specified revision (rev)\ndoes contain the folder in question.\n\nAfter reviewing the source code, I identified that the check for the\nexistence of path is performed against the current working directory,\nrather than validating whether path exists under the given revision\n(rev). As a workaround, I temporarily created the corresponding folder\nlocally, which allowed the split operation to proceed successfully.\n\nWhile this workaround resolved my immediate issue, I believe the\ncurrent behavior is unreasonable. The error message is misleading and\ndoes not reflect the actual problem. I suggest modifying the\nvalidation logic to check for the existence of path under the\nspecified revision (rev), rather than in the current working\ndirectory.\n\nMy environment:\nGit version: 2.52.0.windows.1\n\nThank you for your time and consideration.\n\nBest regards\n"}]}