Paraview Superbuild fails because of git

Hey! I am trying to build paraview with the superbuild on Arch Linux. I have enabled all available packages but some of them fail because of the following error

FAILED: superbuild/zlib/stamp/zlib-zlib-patch-pcfile-rel-prefix /home/max/paraview/build/superbuild/zlib/stamp/zlib-zlib-patch-pcfile-rel-prefix
cd /home/max/paraview/build/superbuild/zlib/src && /usr/bin/git --git-dir= apply --whitespace=fix -p1 /home/max/paraview/paraview-superbuild/superbuild/projects/patches/zlib-pcfile-rel-prefix.patch && /usr/bin/cmake -E touch /home/max/paraview/build/superbuild/zlib/stamp/zlib-zlib-patch-pcfile-rel-prefix
warning: unable to access '/config': Is a directory
warning: unable to access '/config': Is a directory
fatal: unknown error occurred while reading the configuration files

but this is just one example of many packages which fail to compile, or even download, because of a similar error.
I have already pinpointed that it might be a wrong git config but deleting all .gitconfig files and my .git config directory from my system and reinstalling git does not solve the problem.
If i use the same steps on my laptop it is working by the way.

Did anybody ever had this kind of issue or knows some help?

Do you have some kind of git wrapper or hook globally installed? Where is the warning coming from?r

What do you mean by git wrapper? I have installed VS code with the git extension, could that be interfering? I don’t have any hooks since i have deleted the ~/.git folder.

The warning is coming from the compiler downloading packages and i think also from applying patches. This particular error seems to stem from such a patch. I use basically the standard way of compiling, i.e.

git clone --recursive
mkdir build
cd build
ccmake ../paraview-superbuild -GNinja # Making configurations

And some of the packages (e.g. zlib, bzip, ffi etc) are not compiling because of a similar error as in the original post.

Okay wow i found the issue (more or less)
The problem arises from the --git-dir= command from the patch application git apply. I found a very brain dead workaround by, after configuration with cmake and ninja, just deleting the --git-dir= from all the patches in the file.
I still don’t know whats wrong with my git configuration but this solves the issue. What is this command useful anyways? Would it be maybe better to throw it away all together?

Anyways thanks for trying to help me!

So git apply first looks for a git repository to apply the given patch to. However, we’re never doing that, so instead we say “(Jedi hand wave) there’s no Git repository here, act like patch” so that we can avoid having to figure out how to otherwise apply a diff on a barebones Windows installation. It seems like something is very unhappy in your configuration with an empty path passed here as it doesn’t check “does git-dir exist?” before trying to look for a configuration file for it. Finding out what, exactly, is looking for a repository config file here would be good. strace -o strace.log -f -e file git --git-dir apply --allow-empty /dev/null may help.