Skip to content

Add ownership of the git configuration file - #11180

Draft
ekohl wants to merge 1 commit into
theforeman:rpm/developfrom
ekohl:rpm/develop-add-git-config-file
Draft

Add ownership of the git configuration file#11180
ekohl wants to merge 1 commit into
theforeman:rpm/developfrom
ekohl:rpm/develop-add-git-config-file

Conversation

@ekohl

@ekohl ekohl commented Aug 28, 2024

Copy link
Copy Markdown
Member

This allows users to run git config commands without having to set up permissions. The config file is marked as noreplace to respect the user's content.

A %ghost may also work, but I'm not sure.

This came up in theforeman/foreman-documentation#3243 and I think this can simplify the procedure for users.

%{foreman_assets_foreman}
%{foreman_webpack_plugin}
%{foreman_webpack_foreman}
%attr(0600, foreman, foreman) %config(noreplace) %{foreman_dir}/.config/git/config

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would this leave us with %{foreman_dir}/.config/ and %{foreman_dir}/.config/git/ being not owned by this package or any other package? I think so what makes me think we need then to add two %dir directives for them.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would this leave us with %{foreman_dir}/.config/ and %{foreman_dir}/.config/git/ being not owned by this package or any other package?

Looks like it

# dnf whatprovides ~foreman/.config/git/config
Last metadata expiration check: 0:08:59 ago on Thu Aug 29 14:23:44 2024.
rubygem-foreman_templates-9.5.1-2.fm3_13.el9.noarch : Template-syncing engine for Foreman
Repo        : @System
Matched from:
Filename    : /usr/share/foreman/.config/git/config

# dnf whatprovides ~foreman/.config/git/
Last metadata expiration check: 0:08:56 ago on Thu Aug 29 14:23:44 2024.
Error: No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.

# dnf whatprovides /usr/share/foreman/.config
Last metadata expiration check: 0:09:45 ago on Thu Aug 29 14:23:44 2024.
Error: No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Would this leave us with %{foreman_dir}/.config/ and %{foreman_dir}/.config/git/ being not owned by this package or any other package? I think so what makes me think we need then to add two %dir directives for them.

I thought about that when writing it, but wasn't quite sure. It reminds that #9705 should be finished up as well.

This allows users to run git config commands without having to set up
permissions. The config file is marked as noreplace to respect the
user's content.
@ekohl
ekohl force-pushed the rpm/develop-add-git-config-file branch from 3089d15 to cbb12ce Compare August 29, 2024 14:58
@ekohl

ekohl commented Sep 3, 2024

Copy link
Copy Markdown
Member Author

If/When this is merged, we should submit a docs update to simplify the procedure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants