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

Re: fast-import should fail on invalid unsupported paths

From
Jeff King <peff@peff.net>
Date
Mar 18, 2019, 21:17 UTC
Message-ID
<20190318211737.GC29661@sigill.intra.peff.net>
In-Reply-To
<CAKChYSo9x5k0Ly2CNs5tbZ+jMdxBmDLZ9gm_645pwXZsCQ4ySg@mail.gmail.com>
On Mon, Mar 18, 2019 at 06:28:16PM +0100, Björn Kautler wrote:
> 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.
Yeah, that seems quite sensible to me[1].

If you (or anybody else) are interested in working on this, I suspect the answer is to just sprinkle some calls to verify_path() in the right spots. Probably in fast-import.c:file_change_m(), etc.

-Peff
[1] Stretching to think of a way this might backfire, I guess somebody
    could be using Git as an intermediate format to then convert to
    another system. But that seems terribly obscure, and at most I think
    we should give that case an escape hatch to disable the check; it
    should definitely be on by default.
Previous: Björn KautlerNext: Björn Kautler
Message 2 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.