git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fast-import should fail on invalid unsupported paths
@ 2019-03-18 17:28 Björn Kautler
  2019-03-18 21:17 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Björn Kautler @ 2019-03-18 17:28 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-19  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-18 17:28 fast-import should fail on invalid unsupported paths Björn Kautler
2019-03-18 21:17 ` Jeff King
2023-04-14 11:54   ` Björn Kautler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).