{"thread":{"id":"50773","subject":"fast-import should fail on invalid unsupported paths","startedAt":"2019-03-18T17:56:38Z","lastAt":"2023-04-19T08:31:52Z","messageCount":3,"participants":["Björn Kautler","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"371830","messageId":"CAKChYSo9x5k0Ly2CNs5tbZ+jMdxBmDLZ9gm_645pwXZsCQ4ySg@mail.gmail.com","threadId":"50773","inReplyTo":null,"subject":"fast-import should fail on invalid unsupported paths","fromName":"Björn Kautler","fromEmail":"bjoern@kautler.net","sentAt":"2019-03-18T17:28:16Z","receivedAt":"2019-03-18T17:56:38Z","isPatch":false,"sender":{"key":"bjoern@kautler.net","avatar":"https://gravatar.com/avatar/bdced748b9c4d05ea367da8538332227794d2982fb3c3572e3562faf19ec507c?d=mp&s=160"},"body":"Hi,\n\nwith this simple recipe, you get a non-usable repository:\n\nmkdir foo\ncd foo\ngit init --bare repo\ncd repo\ngit fast-import <<\"EOM\"\ncommit refs/heads/master\ncommitter <foo@bar.baz> 0 +0000\ndata 3\nfoo\nM 644 inline foo/.git/bar\ndata 3\nbaz\nEOM\ncd ..\ngit clone repo worktree\n\nThis actually happened when a user tried to port an SVN repository to\na Git repository and had \".git\" paths in the SVN repository.\nUsing KDEs svn2git utility fast-import accepted the invalid path, but\nthen when trying to checkout during the clone operation, you get the\nerror message\n\nCloning into 'worktree'...\ndone.\nerror: Invalid path 'foo/.git/bar'\n\nand the worktree stays empty.\n\nI think fast-import should refuse to import paths Git cannot handle\nproperly later on, so that the migration fails early and the frontend\nthat generates the fast-import stream can be fixed / configured to not\ninclude such invalid paths.\n\nRegards\nBjörn\n"},{"id":"371844","messageId":"20190318211737.GC29661@sigill.intra.peff.net","threadId":"50773","inReplyTo":"CAKChYSo9x5k0Ly2CNs5tbZ+jMdxBmDLZ9gm_645pwXZsCQ4ySg@mail.gmail.com","subject":"Re: fast-import should fail on invalid unsupported paths","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-03-18T21:17:38Z","receivedAt":"2019-03-18T21:17:41Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 18, 2019 at 06:28:16PM +0100, Björn Kautler wrote:\n\n> I think fast-import should refuse to import paths Git cannot handle\n> properly later on, so that the migration fails early and the frontend\n> that generates the fast-import stream can be fixed / configured to not\n> include such invalid paths.\n\nYeah, that seems quite sensible to me[1].\n\nIf you (or anybody else) are interested in working on this, I suspect\nthe answer is to just sprinkle some calls to verify_path() in the right\nspots. Probably in fast-import.c:file_change_m(), etc.\n\n-Peff\n\n[1] Stretching to think of a way this might backfire, I guess somebody\n    could be using Git as an intermediate format to then convert to\n    another system. But that seems terribly obscure, and at most I think\n    we should give that case an escape hatch to disable the check; it\n    should definitely be on by default.\n"},{"id":"475682","messageId":"CAKChYSonyAw9Gr+vxDsCr4dDE0hvc9ZM6+spJo19h85R357Qkw@mail.gmail.com","threadId":"50773","inReplyTo":"20190318211737.GC29661@sigill.intra.peff.net","subject":"Re: fast-import should fail on invalid unsupported paths","fromName":"Björn Kautler","fromEmail":"bjoern@kautler.net","sentAt":"2023-04-14T11:54:40Z","receivedAt":"2023-04-19T08:31:52Z","isPatch":false,"sender":{"key":"bjoern@kautler.net","avatar":"https://gravatar.com/avatar/bdced748b9c4d05ea367da8538332227794d2982fb3c3572e3562faf19ec507c?d=mp&s=160"},"body":"Hi,\n\nI just want to note that this is still reproducible using 2.40.0. :-)\n\nRegards\nBjörn\n"}]}