From: Stefan Sperling Subject: Re: avoid per tree-entry asprintf/free To: Martijn van Duren Cc: Omar Polo , gameoftrees@openbsd.org Date: Tue, 24 Feb 2026 22:14:48 +0100 On Tue, Feb 24, 2026 at 10:07:27PM +0100, Martijn van Duren wrote: > So one option could be to not accept paths inside a repo that're longer > than _POSIX_PATH_MAX, so that every OS should be able to extract it > (even if only under /), but use PATH_MAX for in memory. > Another option could be to always use PATH_MAX, and say that maximum > compat is with the OS with the largest PATH_MAX, and if you have a > repo with paths more than PATH_MAX bytes, just buy yourself a better > OS. > > Regardless of choice, I think these two options should be the foundation > of choosing one over the other. PATH_MAX in the diff is just the initial size of the path buffer. We will grow it further if needed. In fact, we have to. Because, unfortunately, the Git repository format does not restrict the length of paths at all. The OS where the files get checked out might enforce a limit. But Git doesn't care.