actionless / pikaur

AUR helper with minimal dependencies. Review PKGBUILDs all in once, next build them all without user interaction.
GNU General Public License v3.0
875 stars 89 forks source link

Request: Option to add git safe.directory exception #795

Closed samuel-jimenez closed 5 months ago

samuel-jimenez commented 6 months ago
pikaur -Vq
Pikaur v1.20.r6.g1821e8d
Description:

Attempting to perform git operations of non-owned paths will result in the following failure:

fatal: detected dubious ownership in repository at '/path/to/.cache/pikaur/build/quaternion/src/quaternion'
To add an exception for this directory, call:

    git config --global --add safe.directory /path/to/.cache/pikaur/build/quaternion/src/quaternion

pikaur then fails with one of the following:

==> ERROR: /path/to/.cache/pikaur/build/quaternion/quaternion is not a clone of https://github.com/quotient-im/Quaternion
==> ERROR: Failure while creating working copy of quaternion git repo
==> ERROR: Failure while updating working copy of quaternion git repo
Request:

Could an option be added to the recovery menu that will run whatever git is complaining about?

git config --global --add safe.directory /path/to/git/whining

Something along these lines:

:: Try recovering?
[R] retry build
[p] PGP check skip
[c] checksums skip
[f] skip 'check()' function of PKGBUILD
[n] skip 'prepare()' function of PKGBUILD
[i] ignore architecture
[d] delete build dir and try again
[g] add an exception in git and try again
[e] edit PKGBUILD
------------------------
[s] skip building this package
[a] abort building all the packages
actionless commented 5 months ago

Could an option be added to the recovery menu that will run whatever git is complaining about?

git error messages don't have any specific formatting which could be parsed

i think you could solve it by just running:

git config --global --add safe.directory /path/to/.cache/pikaur/build/