__git: mode surprisingly applies recursively #48

Open
opened 2021-11-20 11:25:10 +00:00 by ungleich-gitea · 6 comments

I would expect __git stuff --source origin --mode 0755 not to apply recursively, but instead just to the upper-level directory.

Git saves parameters in the repository itself, so in most cases that's what I, as a user, would want.

I propose adding a --mode-recursive boolean parameter for people who absolutely need current behaviour and changing the default behaviour to what I described before.

Currently preparing a MR with some fixes for non-Linux OSs, so closing this issue after some discussion would be easily done there as well.

I would expect `__git stuff --source origin --mode 0755` not to apply recursively, but instead just to the upper-level directory. Git saves parameters in the repository itself, so in most cases that's what I, as a user, would want. I propose adding a `--mode-recursive` boolean parameter for people who absolutely need current behaviour and changing the default behaviour to what I described before. Currently preparing a MR with some fixes for non-Linux OSs, so closing this issue after some discussion would be easily done there as well.
evilham was assigned by ungleich-gitea 2021-11-20 11:25:10 +00:00
Author
Owner

I would expect the --mode to only affect the top level directory.
I wonder if there should be a --umask param instead?

I would expect the --mode to only affect the top level directory. I wonder if there should be a --umask param instead?
Author
Owner

@evilham Actually, @nico and @steven have the last say :)
In my opinion, this is likely a bug. Since all files have mode 644 or 755, git actually only pays attention to the executable bit, I wouldn't want all files to have executable bit set.

So I am more for fixing this in the way that mode is applied only to the upper level directory.

@evilham Actually, @nico and @steven have the last say :) In my opinion, this is likely a bug. Since all files have mode 644 or 755, git actually only pays attention to the executable bit, I wouldn't want all files to have executable bit set. So I am more for fixing this in the way that mode is applied only to the upper level directory.
Author
Owner

This was very likely a bug in __git that nobody had noticed. I would be tempted to skip the releng overhead and trust that someone running things as root on their systems will check the changelog, but @poljakowski has the last say on that.
Your approach sounds good from a more conservative releng POV, so I'm totally fine implementing these changes once I have @poljakowski's feedback.

This was very likely a bug in `__git` that nobody had noticed. I would be tempted to skip the releng overhead and trust that someone running things as root on their systems will check the changelog, but @poljakowski has the last say on that. Your approach sounds good from a more conservative releng POV, so I'm totally fine implementing these changes once I have @poljakowski's feedback.
Author
Owner

The --mode-recursive flag is problematic because the default is changed from "recursive mode-setting" to "shallow mode-setting".
This potentially breaks existing setups for users requiring the recursive behaviour.

But I'm curious if recursive mode-setting is actually used/required by anyone?
This looks like a strong indicator of a broken repository or configuration to me.

So my proposal would be to have a --mode-shallow parameter and immediately mark it as deprecated.
I would leave a note in the man page that says that the "shallow" behaviour will be the default soon and if a user actually requires recursive mode-setting they shall shout in the issue tracker or the feature will be removed.

The `--mode-recursive` flag is problematic because the default is changed from "recursive mode-setting" to "shallow mode-setting". This potentially breaks existing setups for users requiring the recursive behaviour. But I'm curious if recursive mode-setting is actually used/required by anyone? This looks like a strong indicator of a broken repository or configuration to me. So my proposal would be to have a `--mode-shallow` parameter and immediately mark it as deprecated. I would leave a note in the man page that says that the "shallow" behaviour will be the default soon and if a user actually requires recursive mode-setting they shall shout in the issue tracker or the feature will be removed.
Author
Owner

mentioned in merge request !894

mentioned in merge request !894
Author
Owner

mentioned in issue #819

mentioned in issue #819
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#48
No description provided.