yadm-dev / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
5.15k stars 177 forks source link

Add config for yadm to create read-only template output #454

Open soraxas opened 1 year ago

soraxas commented 1 year ago

What does this PR do?

Allow user to tell yadm to create read-only template output

What issues does this PR fix or reference?

I always forget that the file I'm editing is an output from yadm template :( and loss my editing. (despite already adding a header notice on the top of the file)

Config via:

$ yadm config yadm.template-read-only true

Previous Behavior

yadm copies perms

New Behavior

yadm copies perms, and optionally, remove write perms

Have [tests][1] been written for this change?

No

Have these commits been [signed with GnuPG][2]?

Yes


P.S. This is a global control.

An alternative solution, that allows per-file controls, is to allow template file to have some extra parameters, e.g., my_config.toml##<condition>,template.esh,template.ro=true

but the original semantic of those values were conditions, so I'm not sure if that'd be a good approach

soraxas commented 1 year ago

A slight bump on this PR:

are there any more blockers for merging this PR?

TheLocehiliosan commented 1 year ago

I adjusted this PR to target the develop branch. Can tests and updates to the manpage be added?

soraxas commented 1 year ago

Hi @TheLocehiliosan ! Man and tests had been added!

TheLocehiliosan commented 1 year ago

@soraxas - I updated the pull request to target the develop branch, but there are conflicts.

Can you rebase your branch to be on top of the develop branch?

soraxas commented 11 months ago

@TheLocehiliosan A slight bump on this PR again