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

fast-import should fail on invalid unsupported paths

From
Björn Kautler <bjoern@kautler.net>
Date
Mar 18, 2019, 17:28 UTC
Message-ID
<CAKChYSo9x5k0Ly2CNs5tbZ+jMdxBmDLZ9gm_645pwXZsCQ4ySg@mail.gmail.com>
Hi,
with this simple recipe, you get a non-usable repository:

mkdir foo cd foo git init --bare repo cd repo git fast-import <<"EOM" commit refs/heads/master committer <foo@bar.baz> 0 +0000 data 3 foo M 644 inline foo/.git/bar data 3 baz EOM cd .. git clone repo worktree

This actually happened when a user tried to port an SVN repository to a Git repository and had ".git" paths in the SVN repository. Using KDEs svn2git utility fast-import accepted the invalid path, but then when trying to checkout during the clone operation, you get the error message

Cloning into 'worktree'... done. error: Invalid path 'foo/.git/bar'

and the worktree stays empty.

I think fast-import should refuse to import paths Git cannot handle properly later on, so that the migration fails early and the frontend that generates the fast-import stream can be fixed / configured to not include such invalid paths.

Regards Björn

Next: Jeff King
Message 1 of 3 in “fast-import should fail on invalid unsupported paths”
  1. Björn KautlerMar 18, 2019
  2. Jeff KingMar 18, 2019
  3. Björn KautlerApr 14, 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.