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

Disable backup entirely? #145

Closed
alok opened this issue Oct 18, 2018 · 14 comments
Closed

Disable backup entirely? #145

alok opened this issue Oct 18, 2018 · 14 comments
Labels
implemented implemented tag means that either an enhancement or feature request has been implemented, or bugfix

Comments

@alok
Copy link

alok commented Oct 18, 2018

I really don't want to save any backups, and would like to leave that task up to version control as I find the backup file to be unnecessary clutter. Is there a way to do this?

@cmhughes
Copy link
Owner

You can use the following

latexindent myfile -o myfile

But I don't recommend it!

@alok
Copy link
Author

alok commented Oct 18, 2018

What if it's being read from STDIN and being written to STDOUT (my use case since I have it integrated with an editor)?

@cmhughes
Copy link
Owner

cmhughes commented Oct 18, 2018 via email

@alok
Copy link
Author

alok commented Oct 18, 2018

If I create a new directory dir with a single file a.tex in it, and then do this:

cd dir
latexindent < a.tex

It creates indent.log anyway, even though -w was not passed to it.

@cmhughes
Copy link
Owner

The log file is not a backup file, it's a log file :)

You can redirect it to a different directory using the -c switch. Alternatively, you can hide it using, for example

latexindent -g=.indent.log

@alok
Copy link
Author

alok commented Oct 18, 2018

Alright, I'll redirect to /dev/null.

@alok alok closed this as completed Oct 18, 2018
@alok
Copy link
Author

alok commented Apr 14, 2021

Turns out redirecting to /dev/null gives the error Can't open /dev/null at /usr/local/texlive/2021/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 165, <> line 309.

@alok alok reopened this Apr 14, 2021
@cmhughes
Copy link
Owner

Can you confirm the version you're using? Did this behaviour change because of an update?

@cmhughes
Copy link
Owner

OK, so how about I remove the 'die' statement for log file creation?

@alok
Copy link
Author

alok commented Apr 20, 2021

using version 3.9.1 (bundled with mactex 2021).

which die statement is that exactly?

@cmhughes
Copy link
Owner

open($logfile,">","${$self}{cruftDirectory}/$logfileName") or die "Can't open $logfileName";

Should be able to remove the die statement without issue.... Some experimentation needed, but should be ok

@cmhughes
Copy link
Owner

If you change line 165 of the above file to

open($logfile,">","${$self}{cruftDirectory}/$logfileName");

does that help....?

cmhughes added a commit that referenced this issue Apr 24, 2021
@cmhughes
Copy link
Owner

logfile die process removed as of da2b15e. this will be part of the next release.

@cmhughes cmhughes added the implemented implemented tag means that either an enhancement or feature request has been implemented, or bugfix label Apr 24, 2021
@cmhughes cmhughes mentioned this issue May 7, 2021
@cmhughes
Copy link
Owner

cmhughes commented Jun 4, 2022

Related, for reference: #333 and #354

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
implemented implemented tag means that either an enhancement or feature request has been implemented, or bugfix
Projects
None yet
Development

No branches or pull requests

2 participants