fedora-copr / copr

RPM build system - upstream for https://copr.fedorainfracloud.org/
113 stars 61 forks source link

rpmbuild: make_srpmbuild, set recursive safe.directory #3464

Closed nikromen closed 1 month ago

nikromen commented 1 month ago

Relates #3421

nikromen commented 1 month ago

success: https://copr.stg.fedoraproject.org/coprs/nikromen/playground/build/2919712/

nikromen commented 1 month ago

@praiskup OK this was reason why we moved repo root as safe directory - https://github.com/fedora-copr/copr/issues/2597#issuecomment-1487901896 so I don't think we should revert this change. We probably want the /* feature

praiskup commented 1 month ago

I still don't get why :sweat_smile: I experimented with permissions like:

# I'm "praiskup"
$ cd /tmp
$ git clone ~/rh/projects/copr/copr
$ cd /tmp/copr
# sudo su
# chown postgres:postgres cli
# git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
# chown postgres:postgres /tmp/copr
# git status
fatal: detected dubious ownership in repository at '/tmp/copr'
To add an exception for this directory, call:

        git config --global --add safe.directory /tmp/cop

IOW, there's no issue with the git tree sub-directory. Only if the top-level directory is mis-owned. But I agree we don't want to revert the change; the problem there clearly fixes the problem if subdirectory is used as cwd.

praiskup commented 1 month ago

We talked about this PR on f2f meeting, and while the <dir> to <dir>/* change is not necessarily needed now (a different fix was needed), some users in the future might consider it useful (they might be doing manual git clone in sub-dirs, and there's no need to bother them with tweaking the safe.directory configuration).

praiskup commented 1 month ago

Jirka promised to update the commit message.

nikromen commented 1 month ago

right, I forgot about that, sorry

nikromen commented 1 month ago

done