Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpmbuild: make_srpmbuild, set recursive safe.directory #3464

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nikromen
Copy link
Member

@nikromen nikromen commented Oct 7, 2024

Relates #3421

@nikromen
Copy link
Member Author

nikromen commented Oct 7, 2024

@@ -17,7 +17,7 @@
MAKE_SRPM_TEPMLATE = (
"set -x && "
'cd {0} && '
'echo -e "[safe]\ndirectory = {4}" > ~/.gitconfig && '
'echo -e "[safe]\ndirectory = {4}/*" > ~/.gitconfig && '
Copy link
Member

@praiskup praiskup Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 edit: I'm not sure

@nikromen nikromen force-pushed the fix-make-srpm branch 3 times, most recently from 10bf1cd to ab0d3b3 Compare October 8, 2024 09:30
@nikromen
Copy link
Member Author

nikromen commented Oct 8, 2024

@praiskup OK this was reason why we moved repo root as safe directory - #2597 (comment) so I don't think we should revert this change. We probably want the /* feature

@praiskup
Copy link
Member

praiskup commented Oct 8, 2024

I still don't get why 😅 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
Copy link
Member

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
Copy link
Member

Jirka promised to update the commit message.

@nikromen
Copy link
Member Author

right, I forgot about that, sorry

This is byproduct of fedora-copr#3421

While <dir> to <dir>/* safe directory is not needed now, since different
fix was applied to the issue above,  some users might consider this
useful - they mmioght be doing manual git clones in their mock
directory, which will raise safe-directory error. There is no need to
bother them with this, thus turning this off for their whole
subdirectory.

Relates fedora-copr#3421
@nikromen
Copy link
Member Author

done

@nikromen nikromen changed the title rpmbuild: use all subdirs as safe in repo root dir, not only top level rpmbuild: make_srpmbuild, set recursive safe.directory Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants