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

Command-line option allowing no backups #333

Closed
tdegeus opened this issue Jan 25, 2022 · 10 comments
Closed

Command-line option allowing no backups #333

tdegeus opened this issue Jan 25, 2022 · 10 comments
Labels

Comments

@tdegeus
Copy link
Contributor

tdegeus commented Jan 25, 2022

I would like a command-line option switching of the the feature of writing .bakX files.

To give an argument: I'm using git so this feature is not useful, rather just adding noise.

(I know it can be done in user settings, but I would like to be able to do it directly from the command-line)

@cmhughes
Copy link
Owner

Have you seen the - c switch?

@tdegeus
Copy link
Contributor Author

tdegeus commented Jan 25, 2022

I had not. But my wish remains unchanged ;)

@cmhughes
Copy link
Owner

cmhughes commented Jan 25, 2022 via email

@tdegeus
Copy link
Contributor Author

tdegeus commented Jan 25, 2022

I'm not asking to remove the option, nor to change the default. I'm just asking to have the option not to write them, in the case that I have everything covered (e.g. with git).

@cmhughes
Copy link
Owner

cmhughes commented Jan 25, 2022 via email

@tdegeus
Copy link
Contributor Author

tdegeus commented Jan 25, 2022

Allright. Thanks for the reply

@tdegeus tdegeus closed this as completed Jan 25, 2022
@tdegeus
Copy link
Contributor Author

tdegeus commented Jan 26, 2022

Just a question out of curiosity : what happens if I have a main.tex and I happen to have made a back-up of something else main.bak0, and I set onlyOneBackUp: 1. Would latexindent.pl then overwrite the unrelated back-up?

@cmhughes
Copy link
Owner

cmhughes commented Jan 26, 2022 via email

@tdegeus
Copy link
Contributor Author

tdegeus commented Jan 26, 2022

Ok, but actually my point was : how does onlyOneBackUp: 1 know that it its backup that it is overwriting?

So my point is the following: having latexindent.pl write files that I don't operate on, makes me more insecure than it makes me feel secure. That's why I suggested the command-line option.

I guess that with the current API I should do something like

latexindent.pl -c ~/.cache/latexindent

if I don't want to worry?

@cmhughes
Copy link
Owner

cmhughes commented Jan 26, 2022 via email

Holzhaus added a commit to Holzhaus/latexindent.pl that referenced this issue Mar 26, 2022
Spamming backup files for files that are already managed by git is
pointless.

By using this new flag, the user explicitly states that he or she wants
to overwrite the files without backup. There is no short option to avoid
triggering this option by accident and the help text should be pretty
clear that using this option is not recommended unless you know what
you're doing. Hence, the risk of accidental data loss something should
be pretty much non-existant.

Also note that almost every other source code formatter has options to
to reformat and overwrite files without creating a backup.

Fixes cmhughes#333.
Holzhaus added a commit to Holzhaus/latexindent.pl that referenced this issue Mar 30, 2022
Spamming backup files for files that are already managed by git is
pointless.

By using this new flag, the user explicitly states that he or she wants
to overwrite the files without backup. There is no short option to avoid
triggering this option by accident and the help text should be pretty
clear that using this option is not recommended unless you know what
you're doing. Hence, the risk of accidental data loss something should
be pretty much non-existant.

Also note that almost every other source code formatter has options to
to reformat and overwrite files without creating a backup.

Fixes cmhughes#333.
Holzhaus added a commit to Holzhaus/latexindent.pl that referenced this issue Mar 30, 2022
Spamming backup files for files that are already managed by git is
pointless.

By using this new flag, the user explicitly states that he or she wants
to overwrite the files without backup. There is no short option to avoid
triggering this option by accident and the help text should be pretty
clear that using this option is not recommended unless you know what
you're doing. Hence, the risk of accidental data loss something should
be pretty much non-existant.

Also note that almost every other source code formatter has options to
to reformat and overwrite files without creating a backup.

Fixes cmhughes#333.
trueNAHO added a commit to trueNAHO/git-hooks.nix that referenced this issue Oct 12, 2024
Add the hooks.latexindent.settings.disableExtraFiles option to prevent
the creation of backup and log files.

Upstream refuses adding an option to disable backup and log file
creation to protect non-version-controlled users from data loss, despite
it being considered unnecessary for those using version control. [1] [2]
[3] Considering that Git is the standard in Nix and required for flakes,
providing this option is reasonable.

[1]: cmhughes/latexindent.pl#145
[2]: cmhughes/latexindent.pl#333
[3]: cmhughes/latexindent.pl#354

Link: cachix#514
trueNAHO added a commit to trueNAHO/git-hooks.nix that referenced this issue Oct 12, 2024
Add the hooks.latexindent.settings.disableExtraFiles option to prevent
the creation of backup and log files.

Upstream refuses adding an option to disable backup and log file
creation to protect non-version-controlled users from data loss, despite
it being considered unnecessary for those using version control. [1] [2]
[3] Considering that Git is the standard in Nix and required for flakes,
providing this option is reasonable.

[1]: cmhughes/latexindent.pl#145
[2]: cmhughes/latexindent.pl#333
[3]: cmhughes/latexindent.pl#354

Link: cachix#514
trueNAHO added a commit to trueNAHO/git-hooks.nix that referenced this issue Oct 12, 2024
Add the hooks.latexindent.settings.disableExtraFiles option to prevent
the creation of backup and log files.

Upstream refuses adding an option to disable backup and log file
creation to protect non-version-controlled users from data loss, despite
it being considered unnecessary for those using version control. [1] [2]
[3] Considering that Git is the standard in Nix and required for flakes,
providing this option is reasonable.

[1]: cmhughes/latexindent.pl#145
[2]: cmhughes/latexindent.pl#333
[3]: cmhughes/latexindent.pl#354

Link: cachix#514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants